blob: cf925f8702cf2effb4d8b08f3d22080412984b9b [file] [log] [blame]
2019-11-25 Brian Burg <bburg@apple.com>
Web Inspector: TabActivity diagnostic event should sample the active tab uniformly
https://bugs.webkit.org/show_bug.cgi?id=204531
Reviewed by Devin Rousso.
Rewrite this class to use a uniform sampling approach. Every n seconds, a timer fires and
samples what the current tab is. If the last user interaction happened up to n seconds ago,
report a TabActivity diagnostic event. Keeping with the previous implementation, samples
are taken every n=60 seconds.
To account for bias in the initial sample when Web Inspector is open, wait m seconds for
the first sample. This accounts for the time between opening Web Inspector and choosing the
desired tab. In my testing, m=10 is enough time to load Web Inspector and switch
immediately to a different tab. In that case, the initial tab would not be sampled as the
active tab even if the last user interaction (clicking tab bar) happened while the initial
tab was displayed. If the recorder's setup() method is called some time after Web Inspector is
opened, then the initial delay will shrink to ensure at least 10s has elapsed since the frontend
finished loading.
* UserInterface/Base/Main.js:
(WI.contentLoaded): Keep a timestamp of when the frontend finished loading.
* UserInterface/Controllers/TabActivityDiagnosticEventRecorder.js:
(WI.TabActivityDiagnosticEventRecorder):
(WI.TabActivityDiagnosticEventRecorder.prototype.setup):
(WI.TabActivityDiagnosticEventRecorder.prototype.teardown):
(WI.TabActivityDiagnosticEventRecorder.prototype._startInitialDelayBeforeSamplingTimer):
(WI.TabActivityDiagnosticEventRecorder.prototype._stopInitialDelayBeforeSamplingTimer):
(WI.TabActivityDiagnosticEventRecorder.prototype._startEventSamplingTimer):
(WI.TabActivityDiagnosticEventRecorder.prototype._stopEventSamplingTimer):
(WI.TabActivityDiagnosticEventRecorder.prototype._sampleCurrentTabActivity):
(WI.TabActivityDiagnosticEventRecorder.prototype._didObserveUserInteraction):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowFocus):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowBlur):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowKeyDown):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowMouseDown):
(WI.TabActivityDiagnosticEventRecorder.prototype._didInteractWithTabContent): Deleted.
(WI.TabActivityDiagnosticEventRecorder.prototype._clearTabActivityTimeout): Deleted.
(WI.TabActivityDiagnosticEventRecorder.prototype._beginTabActivityTimeout): Deleted.
(WI.TabActivityDiagnosticEventRecorder.prototype._stopTrackingTabActivity): Deleted.
(WI.TabActivityDiagnosticEventRecorder.prototype._handleTabBrowserSelectedTabContentViewDidChange): Deleted.
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r242604): Console: unread indicator overlaps selection background of previous scope bar item
https://bugs.webkit.org/show_bug.cgi?id=204630
Reviewed by Timothy Hatcher.
When a new message is added that is immediately filtered, such as from an existing filter or
previously selected scope bar items, rather than show a blinking circle next to the level of
the new message in the scope bar (which doesn't cover the case where there's a filter and
was often hard to notice), add a dismissable warning banner explaning that the message had
been filtered with a button to clear all filters.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
(WI.LogContentView.prototype.didAppendConsoleMessageView):
(WI.LogContentView.prototype._previousMessageRepeatCountUpdated):
(WI.LogContentView.prototype._logCleared):
(WI.LogContentView.prototype._messageSourceBarSelectionDidChange):
(WI.LogContentView.prototype._scopeBarSelectionDidChange):
(WI.LogContentView.prototype._filterMessageElements):
(WI.LogContentView.prototype._showHiddenMessagesBannerIfNeeded): Added.
(WI.LogContentView.prototype._markScopeBarItemUnread): Deleted.
(WI.LogContentView.prototype._markScopeBarItemForMessageLevelUnread): Deleted.
* UserInterface/Views/LogContentView.css:
(.content-view.log):
(.content-view.log > .hidden-messages-banner): Added.
(.content-view.log > .hidden-messages-banner > button): Added.
(.content-view.log > .hidden-messages-banner > .dismiss): Added.
(body[dir=ltr] .content-view.log > .hidden-messages-banner > .dismiss): Added.
(body[dir=rtl] .content-view.log > .hidden-messages-banner > .dismiss): Added.
(.console-messages):
(.log-scope-bar > li:not(.unread) > .indicator): Deleted.
(.log-scope-bar > li.unread > .indicator): Deleted.
(.log-scope-bar > li.unread:hover > .indicator): Deleted.
(.log-scope-bar > li.unread.evaluations > .indicator): Deleted.
(.log-scope-bar > li.unread.errors > .indicator): Deleted.
(.log-scope-bar > li.unread.warnings > .indicator): Deleted.
(.log-scope-bar > li.unread.logs > .indicator): Deleted.
(@keyframes unread-background-pulse): Deleted.
* UserInterface/Views/FindBanner.js:
(WI.FindBanner):
(WI.FindBanner.prototype.clearAndBlur): Added.
(WI.FindBanner.prototype._clearAndBlur): Deleted.
Expose a public way to clear the find banner.
* Localizations/en.lproj/localizedStrings.js:
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: add WI.EngineeringSetting and WI.DebugSetting to avoid callsite checking
https://bugs.webkit.org/show_bug.cgi?id=204785
Reviewed by Timothy Hatcher.
* UserInterface/Base/Setting.js:
(WI.Setting.prototype.get defaultValue): Added.
(WI.EngineeringSetting.prototype.get value): Added.
(WI.EngineeringSetting.prototype.set value): Added.
(WI.DebugSetting.prototype.get value): Added.
(WI.DebugSetting.prototype.set value): Added.
(WI.Setting.prototype.get valueRespectingDebugUIAvailability): Deleted.
Only get/set the `_value` if the `WI.isEngineeringBuild`/`WI.isDebugUIEnabled()`.
* UserInterface/Base/Main.js:
(WI.resolvedLayoutDirection):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):
* UserInterface/Proxies/HeapSnapshotEdgeProxy.js:
(WI.HeapSnapshotEdgeProxy.prototype.isPrivateSymbol):
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.supportsEditingUserAgentShadowTrees):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.get knownNonResourceScripts):
(WI.DebuggerManager.prototype.debuggerDidPause):
(WI.DebuggerManager.prototype.scriptDidParse):
* UserInterface/Controllers/DiagnosticController.js:
(WI.DiagnosticController):
(WI.DiagnosticController.prototype._debugAutoLogDiagnosticEventsSettingDidChange):
(WI.DiagnosticController.prototype._updateRecorderStates):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):
* UserInterface/Debug/UncaughtExceptionReporter.js:
(handleUncaughtExceptionRecord):
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Console: copying an evaluation result shouldn't include the saved variable index
https://bugs.webkit.org/show_bug.cgi?id=204906
Reviewed by Timothy Hatcher.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.toClipboardString):
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: the Classes toggle is drawn on top of other content with no other way of scrolling to it
https://bugs.webkit.org/show_bug.cgi?id=204690
Reviewed by Timothy Hatcher.
Use a vertical flexbox for the contents of sidebar panels instead of absolute positioning so
that the variable height Classes "drawer" can have it's own scroll area and doesn't take up
any space from the rest of the panel's contents.
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.initialLayout):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content):
(.sidebar > .panel.details.css-style > .content ~ :matches(.options-container, .class-list-container)):
(.sidebar > .panel.details.css-style > .content ~ .options-container):
(.sidebar > .panel.details.css-style > .content ~ .class-list-container):
(.sidebar > .panel.details.css-style > .content.has-filter-bar): Deleted.
* UserInterface/Views/Sidebar.css:
(.sidebar > .panel):
(.sidebar > .panel.selected): Deleted.
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Search: there should be some default content when there is no search string
https://bugs.webkit.org/show_bug.cgi?id=204631
Reviewed by Timothy Hatcher.
It's very odd to switch to the Search Tab and find it completely empty, especially if you've
never used it before.
Add basic "No Search String" and "No Search Results" text with a clickable help navigation
item that reveals and focuses the sidebar search input.
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.showDefaultContentView): Added.
(WI.SearchSidebarPanel.prototype.performSearch):
(WI.SearchSidebarPanel.prototype._handleDefaultContentViewSearchNavigationItemClicked): Added.
* Localizations/en.lproj/localizedStrings.js:
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: move the "Add Breakpoint" context menu to be next to the blackboxing context menu item
https://bugs.webkit.org/show_bug.cgi?id=204833
Reviewed by Timothy Hatcher.
Both items are related to JavaScript debugging, so they should be closer together.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Support search on IndexedDB stores and indexes
https://bugs.webkit.org/show_bug.cgi?id=129208
<rdar://problem/16142046>
Reviewed by Timothy Hatcher.
Add filter bars to the navigation bars for `IndexedDB`, `LocalStorage`, and `SessionStorage`.
* UserInterface/Views/StorageTabContentView.js:
(WI.StorageTabContentView.prototype.get canHandleFindEvent): Added.
(WI.StorageTabContentView.prototype.handleFindEvent): Added.
* UserInterface/Views/DOMStorageContentView.js:
(WI.DOMStorageContentView):
(WI.DOMStorageContentView.prototype.get navigationItems): Added.
(WI.DOMStorageContentView.prototype.get canFocusFilterBar): Added.
(WI.DOMStorageContentView.prototype.focusFilterBar): Added.
(WI.DOMStorageContentView.prototype._handleFilterBarFilterDidChange): Added.
* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WI.IndexedDatabaseObjectStoreContentView):
(WI.IndexedDatabaseObjectStoreContentView.prototype.get navigationItems):
(WI.IndexedDatabaseObjectStoreContentView.prototype.get canFocusFilterBar): Added.
(WI.IndexedDatabaseObjectStoreContentView.prototype.focusFilterBar): Added.
(WI.IndexedDatabaseObjectStoreContentView.prototype.dataGridMatchNodeAgainstCustomFilters): Added.
(WI.IndexedDatabaseObjectStoreContentView.prototype._handleFilterBarFilterDidChange): Added.
Check against the `textContent` of each cell for a given `WI.DataGridNode` to see if it
matches the filter text as all of the pieces of data are `WI.RemoteObject`s.
* UserInterface/Views/FilterBar.css:
(.filter-bar):
* UserInterface/Views/NetworkTableContentView.css:
(.content-view.network .navigation-bar .filter-bar): Deleted.
Remove the `background-color` to let it match the background content.
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Network: pressing ⌘F when no network item is selected should focus the filter bar
https://bugs.webkit.org/show_bug.cgi?id=204862
Reviewed by Timothy Hatcher.
* UserInterface/Views/NetworkTabContentView.js:
(WI.NetworkTabContentView.prototype.get canHandleFindEvent): Added.
(WI.NetworkTabContentView.prototype.handleFindEvent): Added.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.get canFocusFilterBar): Added.
(WI.NetworkTableContentView.prototype.focusFilterBar): Added.
2019-12-05 Devin Rousso <drousso@apple.com>
Web Inspector: Quick Console: pressing ⌘F shows a second find banner
https://bugs.webkit.org/show_bug.cgi?id=204861
Reviewed by Timothy Hatcher.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.get supportsCustomFindBanner):
2019-12-05 Simon Fraser <simon.fraser@apple.com>
Fix inspector/css test assertions after r253158
https://bugs.webkit.org/show_bug.cgi?id=204924
Reviewed by Devin Rousso.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.displayNameForPseudoId):
2019-12-04 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: allow inspector to pause provisional page load and restore its state
https://bugs.webkit.org/show_bug.cgi?id=204170
Reviewed by Devin Rousso.
All new targets are now automatically paused on start. For such provisional targets target
manager will run regular initilization code (enable agents etc.) and then resume loading of
the target. Responses and events from the target are defferred until the target is committed
and becomes current main target. When the target manager receives event that the provisional
target has been committed all accumulated protocol messages are replayed and going forward all
new missages will be dispatched as usual.
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager):
(WI.TargetManager.prototype.targetCreated):
(WI.TargetManager.prototype.didCommitProvisionalTarget):
(WI.TargetManager.prototype.targetDestroyed):
(WI.TargetManager.prototype.dispatchMessageFromTarget):
(WI.TargetManager.prototype._createTarget):
(WI.TargetManager.prototype._checkAndHandlePageTargetTransition):
(WI.TargetManager.prototype._checkAndHandlePageTargetTermination):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.Connection):
(InspectorBackend.Connection.prototype.addProvisionalMessage):
(InspectorBackend.Connection.prototype.dispatchProvisionalMessages):
* UserInterface/Protocol/MultiplexingBackendTarget.js:
(WI.MultiplexingBackendTarget.prototype.initialize):
* UserInterface/Protocol/PageTarget.js:
(WI.PageTarget):
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.initialize):
(WI.Target.prototype.get isProvisional):
(WI.Target.prototype.get isPaused):
(WI.Target.prototype.didCommitProvisionalTarget):
* UserInterface/Protocol/WorkerTarget.js:
2019-12-03 Devin Rousso <drousso@apple.com>
Web Inspector: prefer non-blackboxed scripts when showing a source code location link
https://bugs.webkit.org/show_bug.cgi?id=204811
Reviewed by Timothy Hatcher.
* UserInterface/Models/StackTrace.js:
(WI.StackTrace.prototype.get firstNonNativeNonAnonymousNotBlackboxedCallFrame): Added.
(WI.StackTrace.prototype.get firstNonNativeCallFrame): Deleted.
(WI.StackTrace.prototype.get firstNonNativeNonAnonymousCallFrame): Deleted.
Include logic to skip call frames that are blackboxed, unless there are no non-blackboxed
call frames, in which case fall back to the first non-native non-anonymous call frame.
Drive-by: remove unused function.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
(WI.ConsoleMessageView.prototype.clearSessionState): Added.
(WI.ConsoleMessageView.prototype._appendLocationLink):
(WI.ConsoleMessageView.prototype._handleDebuggerBlackboxChanged): Added.
(WI.ConsoleMessageView.prototype.clearSavedVariableState): Deleted.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._sessionStarted):
(WI.LogContentView.prototype._logCleared):
Listen for changes to the debugger blackbox to re-render the location link.
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/CallFrameView.js:
(WI.CallFrameView):
* UserInterface/Views/CallFrameView.css:
(.call-frame.blackboxed > .title, .call-frame.blackboxed:not(:hover, :focus) > .subtitle): Added.
Add a constructor option to control whether blackboxed frames are indicated visually.
2019-12-03 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'navigationItem.parentNavigationBar')
https://bugs.webkit.org/show_bug.cgi?id=204830
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._mainResourceDidChange):
When the main resource changes, make sure to clear the `_forcedAppearance` member variable.
This way, when the main `WI.DOMTreeContentView` reloads, it isn't left in an unknown state.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype._defaultAppearanceDidChange):
(WI.DOMTreeContentView.prototype._toggleAppearance):
Always create the Force Appearance navigation item, rather than destroying and recreating it
each time the page navigates. Instead, just update the tooltip (which was all that really
changed) whenever the default appearance changes. Depending on the timing of events during a
page navigation, `_forceAppearanceButtonNavigationItem` could be `null`.
* UserInterface/Views/ActivateButtonNavigationItem.js:
(WI.ActivateButtonNavigationItem.prototype.set defaultToolTip): Added.
(WI.ActivateButtonNavigationItem.prototype.set activatedToolTip): Added.
Allow the various tooltips to be updated after creation.
2019-12-03 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: stopping time marker is permanently removed when the current recording is cleared
https://bugs.webkit.org/show_bug.cgi?id=204827
Reviewed by Timothy Hatcher.
* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview.prototype._recordingReset):
Re-add the marker (and ensure that it's hidden) when the active recording is reset.
2019-12-02 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Provide UI to convert between sRGB and p3 color spaces
https://bugs.webkit.org/show_bug.cgi?id=203534
<rdar://problem/56688523>
Reviewed by Devin Rousso.
Add context menus:
- "Convert to sRGB" and "Clamp to sRGB" for p3 colors, such as `color(display-p3 0 1 0)`.
- "Convert to Display-P3" for sRGB colors, such as `rgb(0, 255, 0)`.
Shift-clicking the color swatch of sRGB colors now goes through the color function syntax as well.
Shift-clicking the color swatch of Display-P3 colors converts the color to sRGB when it can be lossless.
When the convertion cannot be lossless, Web Inspector beeps.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Utilities.js:
* UserInterface/Models/Color.js:
(WI.Color):
Introduce `_normalizedRGB` property, which stores rgb values from 0 to 1.
Previously, `_rgba` stored values from 0 to 1 for color function format, and from 0 to 255 otherwise.
That required format checks before every `rgb` value access and resulted in silent errors when
the values were in the wrong format.
Store alpha as a separate property to simplify format conversion. Previously, alpha was duplicated between `_rgba` and `_hsla`.
(WI.Color.displayP3toSRGB):
(WI.Color.srgbToDisplayP3): Added.
(WI.Color.prototype.nextFormat):
(WI.Color.prototype.get rgb):
(WI.Color.prototype.get hsl):
(WI.Color.prototype.get normalizedRGB):
(WI.Color.prototype.get rgba):
(WI.Color.prototype.get hsla):
(WI.Color.prototype.get normalizedRGBA):
(WI.Color.prototype.get gamut):
(WI.Color.prototype.set gamut):
(WI.Color.prototype.copy):
(WI.Color.prototype.isKeyword):
(WI.Color.prototype.isOutsideSRGB): Added.
(WI.Color.prototype.canBeSerializedAsShortHEX):
(WI.Color.prototype._toKeywordString):
(WI.Color.prototype._toShortHEXString):
(WI.Color.prototype._toHEXString):
(WI.Color.prototype._toShortHEXAlphaString):
(WI.Color.prototype._toHEXAlphaString):
(WI.Color.prototype._toRGBString):
(WI.Color.prototype._toRGBAString):
(WI.Color.prototype._toFunctionString):
Limit the values to 4 decimals.
(WI.Color.prototype._toHSLString):
(WI.Color.prototype._toHSLAString):
(WI.Color.prototype._hslToRGB):
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype._updateColor):
(WI.ColorPicker.prototype._updateOpacitySlider):
* UserInterface/Views/ColorSquare.css:
(.color-square > .svg-root):
(.color-square > .svg-root > .srgb-edge):
(.color-square > .srgb-label):
(.color-square > .srgb-label:hover):
(.color-square > .srgb-label:hover + .svg-root > .srgb-edge):
(@media (-webkit-device-pixel-ratio: 1)):
(.color-square > .srgb-edge):
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype._drawSRGBOutline):
(WI.ColorSquare):
* UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
(WI.InlineSwatch.prototype._updateSwatch):
(WI.InlineSwatch.prototype._allowShiftClickColor): Added.
(WI.InlineSwatch.prototype._handleContextMenuEvent):
2019-12-02 Devin Rousso <drousso@apple.com>
Web Inspector: Console: the saved result value is still shown after page reload
https://bugs.webkit.org/show_bug.cgi?id=204532
Reviewed by Brian Burg.
Add additional plumbing to remove any `.console-saved-variable` elements whenever a new
session is created, as well as reset the base of the property path to `this`.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._sessionStarted):
(WI.LogContentView.prototype._logCleared):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.clearSavedVariableState): Added.
(WI.ConsoleMessageView.prototype.removeEventListeners): Deleted.
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.prototype.resetPropertyPath): Added.
2019-11-22 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'target.PageAgent.getCompositingBordersVisible')
https://bugs.webkit.org/show_bug.cgi?id=204473
Reviewed by Brian Burg.
Change the definition of `WI.targetsAvailable` and `WI.whenTargetsAvailable` to instead
resolve based on when a page target is created, not the backend target, as the latter can
be a multiplexing target which only has a `Target` domain.
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager.prototype._initializeBackendTarget):
(WI.TargetManager.prototype._initializePageTarget):
* UserInterface/Base/Main.js:
(WI.loaded):
(WI.contentLoaded):
(WI.targetsAvailable):
(WI.whenTargetsAvailable):
* UserInterface/Test/Test.js:
(WI.loaded):
(WI.contentLoaded):
(WI.targetsAvailable):
(WI.whenTargetsAvailable):
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.performSearch):
Only wait for targets if inspecting a web debuggable, as non-web debuggables don't have a
different page target vs the backend target (which is guaranteed to exist anyways).
2019-11-22 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251227): dashboard no longer shows page weight
https://bugs.webkit.org/show_bug.cgi?id=204528
Reviewed by Brian Burg.
`WI.contentLoaded` adds the debuggable type as a class to the `<body>`. In r251227, the
"web" debuggable type was split into "page" and "web-page". Update the few selectors that
used the debuggable type to show/hide parts of the UI.
* UserInterface/Views/DashboardContainerView.css:
(body:matches(.page, .web-page) .toolbar .dashboard-container): Added.
(body:not(.page, .web-page) .toolbar .dashboard-container): Added.
(body.web .toolbar .dashboard-container): Deleted.
(body:not(.web) .toolbar .dashboard-container): Deleted.
* UserInterface/Views/DefaultDashboardView.css:
(body:matches(.page, .web-page) .toolbar.collapsed .dashboard.default > :matches(.resourcesSize, .time, .logs)): Added.
(body:not(.page, .web-page) .toolbar .dashboard.default > :matches(.resourcesCount, .resourcesSize, .time)): Added.
(body.web .toolbar.collapsed .dashboard.default > :matches(.resourcesSize, .time, .logs)): Deleted.
(body:not(.web) .toolbar .dashboard.default > :matches(.resourcesCount, .resourcesSize, .time)): Deleted.
2019-11-20 Brian Burg <bburg@apple.com>
Web Inspector: add support for new kinds of diagnostic events
https://bugs.webkit.org/show_bug.cgi?id=204430
Reviewed by Devin Rousso.
This patch restructures the existing DiagnosticController to support multiple
self-contained event recorders. The first such recorder is for the TabActivity
diagnostic event. More will be added later.
Add two engineering settings: one which auto-logs diagnostic events to Inspector^2 console,
and another which forces DiagnosticController to be active or inactive regardless of
whether a diagnostic logging delegate is actually installed. This is for manual testing.
This patch does not introduce any functionality changes to diagnostic event collection.
The TabActivityDiagnosticeventRecorder still needs some changes for it to sample correctly.
New Test: inspector/unit-tests/diagnostic-controller.html
* UserInterface/Base/Main.js:
(WI.contentLoaded):
* UserInterface/Controllers/DiagnosticController.js:
(WI.DiagnosticController):
(WI.DiagnosticController.prototype.set diagnosticLoggingAvailable):
(WI.DiagnosticController.prototype.addRecorder):
(WI.DiagnosticController.prototype.logDiagnosticEvent):
(WI.DiagnosticController.prototype._debugEnableDiagnosticLoggingSettingDidChange):
(WI.DiagnosticController.prototype._debugAutoLogDiagnosticEventsSettingDidChange):
(WI.DiagnosticController.prototype._updateRecorderStates):
(WI.DiagnosticController.supportsDiagnosticLogging): Deleted.
(WI.DiagnosticController.prototype.logDiagnosticMessage): Deleted.
(WI.DiagnosticController.prototype._didInteractWithTabContent): Deleted.
(WI.DiagnosticController.prototype._clearTabActivityTimeout): Deleted.
(WI.DiagnosticController.prototype._beginTabActivityTimeout): Deleted.
(WI.DiagnosticController.prototype._stopTrackingTabActivity): Deleted.
(WI.DiagnosticController.prototype._handleWindowFocus): Deleted.
(WI.DiagnosticController.prototype._handleWindowBlur): Deleted.
(WI.DiagnosticController.prototype._handleWindowKeyDown): Deleted.
(WI.DiagnosticController.prototype._handleWindowMouseDown): Deleted.
(WI.DiagnosticController.prototype._handleTabBrowserSelectedTabContentViewDidChange): Deleted.
Restructure DiagnosticController to be dumber. It holds on to a list of recorders and
turns them on and off. All event logging goes through one funnel method, which does not
use InspectorFrontendHost at all when running a Web Inspector layout test.
* UserInterface/Controllers/DiagnosticEventRecorder.js: Added.
(WI.DiagnosticEventRecorder):
(WI.DiagnosticEventRecorder.prototype.get name):
(WI.DiagnosticEventRecorder.prototype.get active):
(WI.DiagnosticEventRecorder.prototype.set active):
(WI.DiagnosticEventRecorder.prototype.setup):
(WI.DiagnosticEventRecorder.prototype.teardown):
Add base class for all individual diagnostic event recorders.
* UserInterface/Controllers/TabActivityDiagnosticEventRecorder.js: Copied from Source/WebInspectorUI/UserInterface/Controllers/DiagnosticController.js.
(WI.TabActivityDiagnosticEventRecorder):
(WI.TabActivityDiagnosticEventRecorder.prototype.setup):
(WI.TabActivityDiagnosticEventRecorder.prototype.teardown):
(WI.TabActivityDiagnosticEventRecorder.prototype.handleEvent):
(WI.TabActivityDiagnosticEventRecorder.prototype._didInteractWithTabContent):
(WI.TabActivityDiagnosticEventRecorder.prototype._clearTabActivityTimeout):
(WI.TabActivityDiagnosticEventRecorder.prototype._beginTabActivityTimeout):
(WI.TabActivityDiagnosticEventRecorder.prototype._stopTrackingTabActivity):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowFocus):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowBlur):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowKeyDown):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleWindowMouseDown):
(WI.TabActivityDiagnosticEventRecorder.prototype._handleTabBrowserSelectedTabContentViewDidChange):
Move all user activity tracking to here. Restructure so that the recorder can be
turned on and off (this adds/removes its listeners and timers).
* UserInterface/Main.html: Add new files.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setDiagnosticLoggingAvailable):
Adjust the name, as WI.diagnosticController is no longer underscore-prefixed.
* UserInterface/Base/Setting.js:
Add new settings. Add getter 'valueRespectingDebugUIAvailability' which only
returns default values for Debug/Engineering settings if DebugUI is not enabled.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
Add new settings to Settings Tab UI.
2019-11-21 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Outline sRGB-safe areas on P3 color picker
https://bugs.webkit.org/show_bug.cgi?id=203533
<rdar://problem/56688057>
Reviewed by Brian Burg.
Visualize the edge of sRGB gamut as a white line.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/Color.js:
(WI.Color.displayP3toSRGB.multiplyMatrixByVector):
(WI.Color.displayP3toSRGB):
(WI.Color._toLinearLight):
(WI.Color._gammaCorrect):
Use equations from CSS Color Module Level 4.
* UserInterface/Views/ColorSquare.css:
(.color-square):
(.color-square > .crosshair):
Place the crosshair above the sRGB edge line.
(.color-square .svg-root):
(.color-square .srgb-edge):
(.color-square .srgb-label):
(.color-square .srgb-label:hover):
(.color-square .srgb-label:hover + .svg-root > .srgb-edge):
(@media (-webkit-device-pixel-ratio: 1)):
Make the optical weight of the line on non-retina screens the same as on retina screens.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare):
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype._updateBaseColor):
(WI.ColorSquare.prototype._drawSRGBOutline):
2019-11-21 Devin Rousso <drousso@apple.com>
Web Inspector: call frames from blackboxed scripts should be visually distinct
https://bugs.webkit.org/show_bug.cgi?id=204424
Reviewed by Timothy Hatcher.
Seeing "Deferred pause from blackboxed script" in the Pause Reason does indicate that
something in the Call Stack was blackboxed, but it doesn't clarify what was blackboxed.
Given that the debugger effectively ignores blackboxed scripts, we should distinguish call
frames that were ignored so that it's clear how the current pause location was reached.
* UserInterface/Views/CallFrameTreeElement.js:
(WI.CallFrameTreeElement):
(WI.CallFrameTreeElement.prototype.onattach):
* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame.blackboxed:not(.selected)): Added.
Make blackboxed call frames 50% opaque when not selected. Add additional explanatory text to
the end of the tooltip when hovering blackboxed call frame tree elements.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState):
Update tooltip/contextmenu text to include "blacboxing" so functionality is clearer.
* UserInterface/Models/SourceCodeLocation.js:
(WI.SourceCodeLocation.prototype.populateLiveDisplayLocationTooltip):
Allow a suffix to be added to the end of the live location.
* Localizations/en.lproj/localizedStrings.js:
2019-11-20 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: REGRESSION(r250618): main resource view is empty when pausing on inline 'debugger' statement
https://bugs.webkit.org/show_bug.cgi?id=204086
Reviewed by Devin Rousso.
SourceCodeRevision.currentRevision doesn't create new revisions under the hood anymore.
This allows to avoid undesirable side effects when e.g. text editor tries to read current
content of the SourceCode which results in a new revision (with empty content).
New method editableRevision is introduced for applying changes to the resource while
keeping original content revision intact.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges):
(WI.CSSManager.prototype._resourceContentDidChange):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get currentRevision):
(WI.SourceCode.prototype.get editableRevision):
(WI.SourceCode.prototype.get content):
(WI.SourceCode.prototype.revisionContentDidChange):
* UserInterface/Views/FontResourceContentView.js:
(WI.FontResourceContentView.prototype.dropZoneHandleDrop):
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype._contentAvailable):
(WI.ResourceContentView.prototype._handleImportLocalResourceOverride):
* UserInterface/Views/ScriptContentView.js:
(WI.ScriptContentView.prototype._handleTextEditorContentDidChange):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
2019-11-19 Devin Rousso <drousso@apple.com>
Web Inspector: Local Overrides: the placeholder for the MIME type, status code, and status text is the same as the placeholder URL
https://bugs.webkit.org/show_bug.cgi?id=204330
Reviewed by Joseph Pecoraro.
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype.get serializedData):
(WI.LocalResourceOverridePopover.prototype.show):
(WI.LocalResourceOverridePopover.prototype._createEditor):
* UserInterface/Views/LocalResourceOverridePopover.css:
(.popover .local-resource-override-popover-content .data-grid tr.header-content-type > :matches(.name-column, .value-column)): Added.
Replace the hardcoded `placeholder` with an optional `options` object that can include a
`placeholder` value, allowing each caller to customize what is shown. Disallow selecting the
"Content-Type" header since it's automatically populated, even if there is no set value for
the MIME type or URL (e.g. inferred from placeholders).
Drive-by: if a `CodeMirror` has no value, attempt to use it's placeholder instead.
Drive-by: replace generic `dataGrid` with more specific `this._headersDataGrid`, which is
more clear given how many `WI.DataGrid` are created by this class.
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.get selectable):
(WI.PlaceholderDataGridNode):
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.createSortableDataGrid):
* UserInterface/Views/DOMStorageContentView.js:
(WI.DOMStorageContentView.prototype.itemAdded):
(WI.DOMStorageContentView.prototype._populate):
* UserInterface/Views/EditableDataGridNode.js:
(WI.EditableDataGridNode): Deleted.
* UserInterface/Views/HeapSnapshotClassDataGridNode.js:
(WI.HeapSnapshotClassDataGridNode):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode):
* UserInterface/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js:
(WI.HeapSnapshotInstanceFetchMoreDataGridNode):
* UserInterface/Views/ProfileDataGridNode.js:
(WI.ProfileDataGridNode):
* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.prototype._generateDetailsCanvas2D):
(WI.RecordingStateDetailsSidebarPanel):
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype._createNameValueDataGrid.addDataGridNode):
* UserInterface/Views/TimelineDataGridNode.js:
(WI.TimelineDataGridNode):
Rework constructor of `WI.DataGridNode` to accept an `options`-style object as its second
parameter, instead of separate parameters for each configurable property. Now that this is
able to be done via a single parameter, add support for marking a `WI.DataGridNode` as not
being selectable.
2019-11-19 Brian Burg <bburg@apple.com>
[Cocoa] Add _WKInspector SPI to set diagnostic logging delegate for a local Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=204323
Reviewed by Devin Rousso.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setDiagnosticLoggingAvailable):
Add a stub FrontendAPI method to be filled in later.
2019-11-18 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: copying multiple DOM nodes should copy more than just the last selected node
https://bugs.webkit.org/show_bug.cgi?id=204266
Reviewed by Brian Burg.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.async handleCopyEvent): Added.
(WI.DOMTreeContentView.prototype.handleCopyEvent): Deleted.
Call `DOM.getOuterHTML` for each selected DOM node and join the results with newlines.
* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.getOuterHTML):
(WI.DOMNode.prototype.copyNode): Deleted.
(WI.DOMNode.prototype.copyNode.copy): Deleted.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
(WI.DOMTreeElement.prototype._copyHTML): Deleted.
Simplify API surface.
2019-11-18 Devin Rousso <drousso@apple.com>
Web Inspector: Local Resource Overrides: allow substitution based on a url pattern
https://bugs.webkit.org/show_bug.cgi?id=202375
Reviewed by Brian Burg.
Often, websites will load content with a timestamp-based URL query parameter for
cache-busting or logging purposes. If a developer is trying to override these resources (or
is trying to have an existing override also match these resources), they'd need to edit the
local override's URL to match in addition to editing the resource that loads it (e.g. change
the <script> in an HTML file), which can sometimes be tricky of the content is dynamically
loaded (e.g. an XHR with a non-hardcoded URL).
Allowing for local overrides to be set using a regular expression pattern would help resolve
this limitation.
* UserInterface/Models/LocalResourceOverride.js:
(WI.LocalResourceOverride):
(WI.LocalResourceOverride.create):
(WI.LocalResourceOverride.fromJSON):
(WI.LocalResourceOverride.prototype.toJSON):
(WI.LocalResourceOverride.prototype.get isCaseSensitive): Added.
(WI.LocalResourceOverride.prototype.get isRegex): Added.
(WI.LocalResourceOverride.prototype.matches): Added.
(WI.LocalResourceOverride.prototype.saveIdentityToCookie):
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.prototype.initializeTarget):
(WI.NetworkManager.prototype.get localResourceOverrides):
(WI.NetworkManager.prototype.addLocalResourceOverride):
(WI.NetworkManager.prototype.removeLocalResourceOverride):
(WI.NetworkManager.prototype.localResourceOverrideForURL):
(WI.NetworkManager.prototype.responseIntercepted):
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover):
(WI.LocalResourceOverridePopover.prototype.get serializedData):
(WI.LocalResourceOverridePopover.prototype.show):
(WI.LocalResourceOverridePopover.prototype._createEditor):
* UserInterface/Views/LocalResourceOverrideTreeElement.js:
(WI.LocalResourceOverrideTreeElement.prototype.get mainTitleText): Added.
(WI.LocalResourceOverrideTreeElement.prototype.onattach):
(WI.LocalResourceOverrideTreeElement.prototype.ondetach):
(WI.LocalResourceOverrideTreeElement.prototype.populateContextMenu):
(WI.LocalResourceOverrideTreeElement.prototype.willDismissPopover):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._willDismissLocalOverridePopover):
2019-11-15 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: support multiline CSS property values
https://bugs.webkit.org/show_bug.cgi?id=203754
<rdar://problem/56819044>
Reviewed by Brian Burg.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.update):
(WI.CSSProperty.prototype._updateStyleText):
When the property is updated from the backend, find the first newline inside the value and
preserve the indent string so it can be re-added when updating the backend.
* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField.prototype._handleKeyDown):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property:not(.disabled) .value):
(.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .value): Added.
(.spreadsheet-style-declaration-editor .property:not(.disabled).has-newline .semicolon): Added.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.updateStatus):
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldAllowsNewlines): Added.
(WI.SpreadsheetStyleProperty.prototype._handleValueChange):
Support shift-enter when editing a CSS property's value to insert a newline.
2019-11-15 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: move the "Local Override..." creation context menu item from the Breakpoints section options menu to the Create Resource menu
https://bugs.webkit.org/show_bug.cgi?id=204178
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissLocalOverridePopover):
(WI.SourcesNavigationSidebarPanel.prototype._addLocalOverride):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu):
If the Local Overrides section isn't already visible, show it. Use the Local Overrides title
as the anchor for the configuration popover. If there are no existing Local Overrides, show
placeholder "No Overrides" text temporarily.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype._showSuggestionsView):
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype._presentOverTargetElement):
* UserInterface/Views/URLBreakpointPopover.js:
(WI.URLBreakpointPopover.prototype._presentOverTargetElement):
Add some padding around the popover's anchor so the arrow doesn't overlap it.
* Localizations/en.lproj/localizedStrings.js:
2019-11-15 Devin Rousso <drousso@apple.com>
Web Inspector: Local Overrides: add context menu item to reveal the local override when a resource is loaded from it
https://bugs.webkit.org/show_bug.cgi?id=204206
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* Localizations/en.lproj/localizedStrings.js:
2019-11-15 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: "Style Sheet" appears twice in the resource type scope bar
https://bugs.webkit.org/show_bug.cgi?id=204172
Reviewed by Joseph Pecoraro.
* UserInterface/Models/Resource.js:
(WI.Resource):
(WI.Resource.prototype.updateForResponse):
Remove compatibility `WI.Resource.Type.Stylesheet` (which previously existed since the
protocol values for `Page.ResourceType` match the keys) and instead add compatibility cases
at the necessary callsites.
2019-11-13 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: "aqua" and "fuchsia" aren't detected as colors
https://bugs.webkit.org/show_bug.cgi?id=204085
Reviewed by Devin Rousso.
* UserInterface/Models/Color.js:
2019-11-13 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Invalid type of argument 'eventName' for command 'DOMDebugger.setEventBreakpoint' call. It must be 'string' but it is 'object'.
https://bugs.webkit.org/show_bug.cgi?id=204176
Reviewed by Timothy Hatcher.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype.dismiss):
Only create the `WI.EventBreakpoint` if the <input> has a value.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.addURLBreakpoint):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._willDismissEventBreakpointPopover):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissURLBreakpointPopover):
Drive-by: if the configuration isn't valid (e.g. no breakpoint) or the breakpoint already
exists, beep.
2019-11-12 Devin Rousso <drousso@apple.com>
Web Inspector: Local Overrides: drop zone overlay doesn't take up the full content area
https://bugs.webkit.org/show_bug.cgi?id=204093
Reviewed by Joseph Pecoraro.
* UserInterface/Views/FontResourceContentView.css:
(.content-view.resource.font > :matches(.local-resource-override-label-view, .local-resource-override-warning-view):not([hidden]) ~ .drop-zone): Added.
(.content-view.resource.font > .drop-zone): Deleted.
* UserInterface/Views/ImageResourceContentView.css:
(.content-view.resource.image > :matches(.local-resource-override-label-view, .local-resource-override-warning-view):not([hidden]) ~ .drop-zone): Added.
(.content-view.resource.image > .drop-zone): Deleted.
2019-11-12 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: create/update local override drop zone shown in image collection view
https://bugs.webkit.org/show_bug.cgi?id=204097
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CollectionContentView.js:
(WI.CollectionContentView):
(WI.CollectionContentView.prototype.get contentViewConstructorOptions): Added.
(WI.CollectionContentView.prototype.addContentViewForItem):
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView.prototype.get contentViewConstructorOptions): Added.
Provide a way to pass options when instantiating the content view from the constructor.
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView.prototype.contentAvailable):
Support an optional object parameter that can be used to disable the `WI.DropZone`.
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251958): console prompt is automatically focused when page is reloaded
https://bugs.webkit.org/show_bug.cgi?id=203932
Reviewed by Timothy Hatcher.
* UserInterface/Base/Main.js:
(WI._restoreCookieForOpenTabs):
Only attempt to autofocus when Web Inspector is first opened.
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r250087): inspector/model/remote-object.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=202934
<rdar://problem/56270900>
Reviewed by Timothy Hatcher.
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.addShowMoreIfNeeded):
Drive-by: ensure that the indeterminate progress spinner is added after the last button.
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r249451): missing "Reveal in DOM Tree" on nodes logged to the console
https://bugs.webkit.org/show_bug.cgi?id=203836
Reviewed by Timothy Hatcher.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
DOM trees in the console are marked as being non-editable, which is intended to prevent
modifications (e.g. changing an attribute) from being made in the console as the DOM tree
there is not hooked up to the associated DOM agent. In r249451 however, this guard was over
expanded to include non-editing actions, like "Reveal in DOM Tree" and DOM breakpoints.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._handleContextMenuEvent):
Drive-by: add a separator before "Copy Selected" so it doesn't end up in the same group as
any "Collapse All" from a `WI.TreeOutline`.
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: Local Resource Overrides: automatically show a file picker when attempting to create an override for non-text resources
https://bugs.webkit.org/show_bug.cgi?id=203917
Reviewed by Timothy Hatcher.
Since there's no way to edit non-text resources (e.g. images, fonts, etc.) in Web Inspector,
when creating a local override for non-text resources, default to showing a file picker and
creating a local override from the content and MIME type of whatever file is chosen.
Still provide a way (shift-click) to create a local override for non-text resources from the
resource's contents, as that can be useful if the user just wants to change some headers.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.async createLocalResourceOverride):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView):
(WI.ResourceContentView.prototype.get createLocalResourceOverrideTooltip): Added.
(WI.ResourceContentView.prototype.requestLocalResourceOverrideInitialContent): Added.
(WI.ResourceContentView.prototype.async _getContentForLocalResourceOverrideFromFile): Added.
(WI.ResourceContentView.prototype._handleCreateLocalResourceOverride):
(WI.ResourceContentView.prototype._handleImportLocalResourceOverride):
(WI.ResourceContentView.prototype.localResourceOverrideInitialContent): Deleted.
(WI.ResourceContentView.prototype.async _handleCreateLocalResourceOverride): Deleted.
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype.get createLocalResourceOverrideTooltip): Added.
(WI.TextResourceContentView.prototype.requestLocalResourceOverrideInitialContent): Added.
(WI.TextResourceContentView.prototype.localResourceOverrideInitialContent): Deleted.
* Localizations/en.lproj/localizedStrings.js:
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: add a marker for when a stop was requested
https://bugs.webkit.org/show_bug.cgi?id=203935
Reviewed by Timothy Hatcher.
After r244195, the Web Inspector frontend doesn't stop updating the current time marker
until after it receives all of the corresponding `*.trackingComplete` events. This means
that sometimes, the current time marker can move far past the time at which the stop was
requested, such as if there's a blocking script.
We should indicate where the stop was requested, as that is often right after a particular
issue is reproduced during a timeline recording, rather than have the user try to figure out
where they stopped.
Only keep a marker for the last stop request, and hide the marker once capturing resumes.
It's still useful to have the current time marker continue updating, as we should show all
the information we have about captured things, such as blocking scripts.
* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged):
* UserInterface/Models/TimelineMarker.js:
* UserInterface/Views/TimelineRuler.js:
(WI.TimelineRuler.prototype.addMarker):
* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .markers > .marker.stopping-time): Added.
(.timeline-ruler > .markers > .marker.current-time):
(.timeline-ruler > .markers > .marker:matches(.stopping-time, .current-time)::after): Added.
(@media (prefers-color-scheme: dark) .timeline-ruler > .markers > .marker.stopping-time): Added.
(.timeline-ruler > .markers > .marker.current-time::after): Deleted.
Make the current time marker always on top (`z-index`).
* Localizations/en.lproj/localizedStrings.js:
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251958): automatic console prompt focusing prevents any "space" shortcuts from working
https://bugs.webkit.org/show_bug.cgi?id=203939
Reviewed by Timothy Hatcher.
* UserInterface/Base/Main.js:
(WI.isShowingTimelineTab): Added.
(WI.isShowingAuditTab): Added.
(WI._restoreCookieForOpenTabs):
2019-11-07 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Unable to get object details - GlobalObject
https://bugs.webkit.org/show_bug.cgi?id=203930
<rdar://problem/56960937>
In r248286, calls to `Heap.snapshot`, `Heap.getPreview`, and `Heap.getRemoteObject` were
moved to the `WI.HeapManager` instead of being inside view code. During this move, extra
`WI.reportInternalError` calls were added, which wasn't entirely correct as it is fully
possible (and expected) that any of these commands are invoked with old heap snapshot nodes
that may no longer exist. As such, calling any error an "internal error" isn't strictly
correct, and instead should just be a log. Also, the frontend code that calls these commands
is able to handle errors, again because it is expected.
Reviewed by Brian Burg.
* UserInterface/Controllers/HeapManager.js:
(WI.HeapManager.prototype.snapshot):
(WI.HeapManager.prototype.getPreview):
(WI.HeapManager.prototype.getRemoteObject):
2019-11-06 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Display color picker for p3 colors
https://bugs.webkit.org/show_bug.cgi?id=203436
<rdar://problem/56635062>
Reviewed by Brian Burg.
For p3 colors, display ColorSquare with display-p3 gamut.
Continue showing ColorSquare with sRGB gamut by default.
* UserInterface/Base/Setting.js:
* UserInterface/Models/Color.js:
(WI.Color):
(WI.Color.rgb2hsv):
(WI.Color.hsv2rgb.fraction):
(WI.Color.hsv2rgb):
(WI.Color.prototype.get hsla):
(WI.Color.prototype.isKeyword):
* UserInterface/Views/ColorPicker.css:
(.color-picker > .hue):
(@media (color-gamut: p3)):
(.color-picker.gamut-p3 > .hue):
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype._updateColor):
(WI.ColorPicker.prototype._updateOpacitySlider):
(WI.ColorPicker.prototype._handleFormatChange):
Introduce `gamut` parameter. Previously, the only available `gamut` was sRGB.
* UserInterface/Views/ColorSquare.css:
(.color-square > .crosshair):
Update the crosshair style to look better for both light and dark backgrounds.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare):
(WI.ColorSquare.prototype.get tintedColor):
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype._setCrosshairPosition):
(WI.ColorSquare.prototype._updateBaseColor):
(WI.ColorSquare.prototype._updateCrosshairBackground):
* UserInterface/Views/InlineSwatch.js:
Make p3 color picker a preview (e.g. STP-only) feature.
2019-11-05 Ross Kirsling <ross.kirsling@sony.com>
Web Inspector: Layers: enable tab by default
https://bugs.webkit.org/show_bug.cgi?id=203833
Reviewed by Timothy Hatcher.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Views/ContextMenuUtilities.js:
* UserInterface/Views/LayersTabContentView.js:
(WI.LayersTabContentView.isTabAllowed):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
2019-11-04 Devin Rousso <drousso@apple.com>
Web Inspector: "Toggle Visibility" does not work for element inside Shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=202218
<rdar://problem/55713078>
Reviewed by Brian Burg.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.toggleElementVisibility.inspectedPage_node_injectStyleAndToggleClass):
If the node is inside a shadow tree, store the `<style>` inside the shadow root instead of
always using `document.head`.
2019-11-02 Devin Rousso <drousso@apple.com>
Web Inspector: Add diagnostic logging for frontend feature usage
https://bugs.webkit.org/show_bug.cgi?id=203579
<rdar://problem/56717410>
Reviewed by Brian Burg.
Add a `DiagnosticController` class for reporting Web Inspector telemetry.
The controller initially measures a single "TabActivity" data point,
which logs the active tab during the specified time interval (one minute).
If the UI is not active during the time interval, no logging takes place.
The UI is considered to be active if mouse/keyboard interaction occurs
during the time interval, or the selected `TabContentView` changes.
Original patch by Matt Baker <mattbaker@apple.com>.
* UserInterface/Controllers/DiagnosticController.js: Added.
(WI.DiagnosticController):
(WI.DiagnosticController.supportsDiagnosticLogging):
(WI.DiagnosticController.prototype.logDiagnosticMessage):
(WI.DiagnosticController.prototype._didInteractWithTabContent):
(WI.DiagnosticController.prototype._clearTabActivityTimeout):
(WI.DiagnosticController.prototype._beginTabActivityTimeout):
(WI.DiagnosticController.prototype._stopTrackingTabActivity):
(WI.DiagnosticController.prototype._handleWindowFocus):
(WI.DiagnosticController.prototype._handleWindowBlur):
(WI.DiagnosticController.prototype._handleWindowKeyDown):
(WI.DiagnosticController.prototype._handleWindowMouseDown):
(WI.DiagnosticController.prototype._handleTabBrowserSelectedTabContentViewDidChange):
* UserInterface/Main.html:
* UserInterface/Base/Main.js:
(WI.contentLoaded):
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: switching tabs should re-focus the previously focused element
https://bugs.webkit.org/show_bug.cgi?id=203744
Reviewed by Brian Burg.
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype._tabBarItemSelected):
(WI.TabBrowser.prototype._saveFocusedNodeForTabContentView): Added.
(WI.TabBrowser.prototype._restoreFocusedNodeForTabContentView): Added.
Store the `document.activeElement` on the `WI.TabContentView` and `.focus()` it after we're
done showing the newly selected tab, but only if there isn't already something focused.
* UserInterface/Views/TabBar.js:
(WI.TabBar.prototype.set selectedTabBarItem):
* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar.prototype.set selectedTabBarItem):
Include the previously selected tab bar item when dispatching selection change events.
* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObject):
Don't omit focus when revealing represented objects.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: add a timeline that shows information about any recorded CSS animation/transition
https://bugs.webkit.org/show_bug.cgi?id=203651
<rdar://problem/56128726>
Reviewed by Brian Burg.
Unlike all other forms of Web Animations, CSS animations/transitions, are _not_ created by
JavaScript, and therefore can seemingly appear out of nowhere. This patch expands the Media
timeline to be the Media & Animations timeline, which tracks when CSS animations/transitions
are created, started, delayed, iterated, canceled, or finished.
* UserInterface/Protocol/AnimationObserver.js: Added.
(WI.AnimationObserver.prototype.trackingStart):
(WI.AnimationObserver.prototype.trackingUpdate):
(WI.AnimationObserver.prototype.trackingComplete):
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.get AnimationAgent): Added.
* UserInterface/Main.html:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
Add an Animation domain for handling the tracking of CSS Web Animations.
* UserInterface/Models/MediaInstrument.js:
(WI.MediaInstrument.prototype.startInstrumentation):
(WI.MediaInstrument.prototype.stopInstrumentation):
(WI.MediaInstrument):
* UserInterface/Models/MediaTimeline.js: Added.
(WI.MediaTimeline.prototype.recordForTrackingAnimationId):
(WI.MediaTimeline.prototype.recordForMediaElementEvents):
(WI.MediaTimeline.prototype.reset):
(WI.MediaTimeline.prototype.addRecord):
* UserInterface/Models/MediaTimelineRecord.js:
(WI.MediaTimelineRecord):
(WI.MediaTimelineRecord.async fromJSON):
(WI.MediaTimelineRecord.prototype.toJSON):
(WI.MediaTimelineRecord.prototype.get trackingAnimationId): Added.
(WI.MediaTimelineRecord.prototype.get timestamps): Added.
(WI.MediaTimelineRecord.prototype.get activeStartTime): Added.
(WI.MediaTimelineRecord.prototype.get updatesDynamically): Added.
(WI.MediaTimelineRecord.prototype.get usesActiveStartTime): Added.
(WI.MediaTimelineRecord.prototype.get displayName):
(WI.MediaTimelineRecord.prototype.get subtitle): Added.
(WI.MediaTimelineRecord.prototype.saveIdentityToCookie):
(WI.MediaTimelineRecord.prototype.updateProgress): Added.
(WI.MediaTimelineRecord.prototype.addDOMEvent): Added.
(WI.MediaTimelineRecord.prototype.powerEfficientPlaybackStateChanged): Added.
(WI.MediaTimelineRecord.prototype._updateTimes): Added.
(WI.MediaTimelineRecord.fromJSON): Deleted.
(WI.MediaTimelineRecord.prototype.get domEvent): Deleted.
(WI.MediaTimelineRecord.prototype.get isPowerEfficient): Deleted.
* UserInterface/Models/Timeline.js:
(WI.Timeline.create):
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.async processJSON):
(WI.TimelineManager.prototype.animationTrackingStarted): Added.
(WI.TimelineManager.prototype.animationTrackingUpdated): Added.
(WI.TimelineManager.prototype.animationTrackingCompleted): Added.
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
(WI.TimelineManager.prototype._handleDOMNodePowerEfficientPlaybackStateChanged):
Start/Stop tracking animations based on whether the Media & Animations timeline is enabled.
* UserInterface/Views/MediaTimelineOverviewGraph.js:
(WI.MediaTimelineOverviewGraph):
(WI.MediaTimelineOverviewGraph.get maximumRowCount): Added.
(WI.MediaTimelineOverviewGraph.prototype.reset):
(WI.MediaTimelineOverviewGraph.prototype.layout):
(WI.MediaTimelineOverviewGraph.prototype.updateSelectedRecord):
(WI.MediaTimelineOverviewGraph.prototype._processRecord): Added.
(WI.MediaTimelineOverviewGraph.prototype._processRecord.compareByStartTime): Added.
(WI.MediaTimelineOverviewGraph.prototype._handleRecordAdded):
(WI.MediaTimelineOverviewGraph.prototype._handleTimesUpdated): Added.
(WI.MediaTimelineOverviewGraph.prototype.shown): Deleted.
(WI.MediaTimelineOverviewGraph.prototype.hidden): Deleted.
* UserInterface/Views/MediaTimelineOverviewGraph.css:
(.timeline-overview-graph.media): Added.
(.timeline-overview-graph.media > .graph-row): Added.
(.timeline-overview-graph.media > .graph-row > .timeline-record-bar): Added.
(.timeline-overview-graph.media > .graph-row > .timeline-record-bar:not(.unfinished) > .segment:not(.inactive)): Added.
(.timeline-overview-graph.media:nth-child(even) > .graph-row > .timeline-record-bar:not(.unfinished) > .segment:not(.inactive)): Added.
(.timeline-overview-graph.media > .timeline-record-bar): Deleted.
(.timeline-overview-graph.media > .timeline-record-bar > .segment): Deleted.
* UserInterface/Views/MediaTimelineView.js:
(WI.MediaTimelineView):
(WI.MediaTimelineView.prototype.shown): Added.
(WI.MediaTimelineView.prototype.hidden): Added.
(WI.MediaTimelineView.prototype.closed):
(WI.MediaTimelineView.prototype.reset):
(WI.MediaTimelineView.prototype.dataGridSortComparator):
(WI.MediaTimelineView.prototype.dataGridSortComparator.compareDOMNodes):
(WI.MediaTimelineView.prototype._processPendingRecords):
* UserInterface/Views/MediaTimelineDataGridNode.js:
(WI.MediaTimelineDataGridNode):
(WI.MediaTimelineDataGridNode.prototype.get data):
(WI.MediaTimelineDataGridNode.prototype.createCellContent):
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren): Added.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addReadySegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addDelaySegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addActiveSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addFullScreenSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPowerEfficientPlaybackSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPausedSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.timelineRecordBarCustomChildren.addPlayingSegment): ADded.
(WI.MediaTimelineDataGridNode.prototype.filterableDataForColumn):
(WI.MediaTimelineDataGridNode.prototype._createNameCellDocumentFragment): Added.
(WI.MediaTimelineDataGridNode.prototype.iconClassNames): Deleted.
* UserInterface/Views/TimelineRecordBar.js:
(WI.TimelineRecordBar):
(WI.TimelineRecordBar.prototype.refresh):
(WI.TimelineRecordBar.prototype._handleClick):
* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar):
(.timeline-record-bar > :matches(img, .segment)):
(.timeline-record-bar > img):
(.timeline-record-bar > .segment):
(body[dir=ltr] .timeline-record-bar > .segment):
(body[dir=ltr] .timeline-record-bar > .segment:first-of-type):
(body[dir=ltr] .timeline-record-bar > .segment:last-of-type):
(body[dir=rtl] .timeline-record-bar > .segment):
(body[dir=rtl] .timeline-record-bar > .segment:first-of-type):
(body[dir=rtl] .timeline-record-bar > .segment:last-of-type):
(.timeline-record-bar > .segment:not(:last-of-type)):
(.timeline-record-bar.selected > .segment):
(.timeline-record-bar > .segment.inactive,):
(.timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(:focus .selected .timeline-record-bar:not(.has-custom-children) > .segment):
(:focus .selected .timeline-record-bar:not(.has-custom-children) > .segment.inactive):
(:focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(.timeline-record-bar.timeline-record-type-network > .segment):
(.timeline-record-bar.timeline-record-type-network > .segment.inactive):
(.timeline-record-bar.timeline-record-type-layout > .segment):
(.timeline-record-bar.timeline-record-type-layout.paint > .segment,):
(.timeline-record-bar.timeline-record-type-script > .segment):
(.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment,):
(.timeline-record-bar.timeline-record-type-media > .segment):
(.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment):
(.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment.css-animation-ready):
(.timeline-record-bar.has-custom-children.timeline-record-type-media > .segment:matches(.css-animation-delay, .media-element-paused)):
(.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment):
(.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment.media-element-full-screen):
(.timeline-record-bar.has-custom-children.timeline-record-type-media.media-element > .segment.media-element-power-efficient-playback):
(body[dir=ltr] .timeline-record-bar > .segment.inactive,): Deleted.
(body[dir=ltr] .timeline-record-bar.has-inactive-segment > .segment:not(.inactive),): Deleted.
(:focus .selected .timeline-record-bar > .segment): Deleted.
(:focus .selected .timeline-record-bar > .segment.inactive): Deleted.
(body[dir=ltr] :focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
(body[dir=rtl] :focus .selected .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)): Deleted.
Allow timeline record bars to be customized through a delegate callback. If provided, it
will be used instead of any default content. It is expected to return an array of objects,
each having a `startTime` number, `classNames` array, and `title` string. It can also have a
`endTime` number and an `image` string. If `endTime` is `NaN`, the record is unfinished. If
`image` is provided, an `<img>` will be used instead of a segment, allowing for markers.
* UserInterface/Views/TimelineDataGridNode.js:
(WI.TimelineDataGridNode.prototype.createCellContent):
Add a default fallback for `WI.DOMNode` values.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.displayNameForTimelineType):
(WI.TimelineTabContentView.iconClassNameForRecord):
(WI.TimelineTabContentView.displayNameForRecord):
* UserInterface/Views/TimelineRecordTreeElement.js:
* UserInterface/Views/TimelineIcons.css:
(.animation-frame-record .icon):
(.css-animation-record .icon): Added.
(.css-transition-record .icon): Added.
(.media-element-record .icon): Added.
(.animation-record .icon): Deleted.
(.dom-event-record .icon): Deleted.
(.dom-event-record.fullscreen .icon): Deleted.
(.power-efficient-playback-state-changed-record .icon): Deleted.
* UserInterface/Images/DOMEventFullscreen.svg: Removed.
* UserInterface/Images/EventCancel.svg: Added.
* UserInterface/Images/EventIteration.svg: Added.
* UserInterface/Images/EventPause.svg:
* UserInterface/Images/EventPlay.svg:
* UserInterface/Images/EventProcessing.svg:
* UserInterface/Images/EventStop.svg:
* UserInterface/Images/PowerEfficientPlaybackStateChanged.svg: Removed.
* UserInterface/Images/TimelineRecordAnimationFrame.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/TimelineRecordAnimation.svg.
* UserInterface/Images/TimelineRecordCSSAnimation.svg: Added.
* UserInterface/Images/TimelineRecordCSSTransition.svg: Added.
* UserInterface/Images/TimelineRecordMediaElement.svg: Added.
Add new media icons.
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.async import): Added.
(WI.TimelineRecording.import): Deleted.
* UserInterface/Models/TimelineRecord.js:
* UserInterface/Models/CPUTimelineRecord.js:
* UserInterface/Models/HeapAllocationsTimelineRecord.js:
(WI.HeapAllocationsTimelineRecord.async fromJSON): Added.
(WI.HeapAllocationsTimelineRecord.fromJSON): Deleted.
* UserInterface/Models/LayoutTimelineRecord.js:
* UserInterface/Models/MemoryTimelineRecord.js:
* UserInterface/Models/RenderingFrameTimelineRecord.js:
* UserInterface/Models/ResourceTimelineRecord.js:
* UserInterface/Models/ScriptTimelineRecord.js:
Make the importing of timeline records `async` so we can attempt to rehydrate the DOM nodes
of any media records (as well as wait for heap snapshots).
* UserInterface/Models/DOMNode.js:
(WI.DOMNode):
(WI.DOMNode.prototype.isMediaElement): Added.
(WI.DOMNode.prototype._shouldListenForEventListeners): Deleted.
* Localizations/en.lproj/localizedStrings.js:
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: default to focusing the console prompt if no other content is focused after opening Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=203743
Reviewed by Eric Carlson and Brian Burg.
* UserInterface/Base/Main.js:
(WI.isContentAreaFocused): Added.
(WI.isConsoleFocused):
(WI._focusChanged):
(WI._restoreCookieForOpenTabs):
2019-11-01 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Display color swatches for p3 colors
https://bugs.webkit.org/show_bug.cgi?id=203439
<rdar://problem/56637250>
Reviewed by Devin Rousso.
Detect `color(display-p3 0 1 0)` as a color in the style editor.
* UserInterface/Models/Color.js:
(WI.Color):
(WI.Color.fromString):
(WI.Color.prototype.copy):
(WI.Color.prototype.toString):
(WI.Color.prototype.isKeyword):
(WI.Color.prototype._toFunctionString):
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r249831): content view is empty if a breakpoint is hit in the main resource
https://bugs.webkit.org/show_bug.cgi?id=203722
<rdar://problem/56802409>
Reviewed by Joseph Pecoraro.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get currentRevision):
(WI.SourceCode.prototype.revisionContentDidChange):
(WI.SourceCode.prototype._initializeCurrentRevisionIfNeeded):
(WI.SourceCode.prototype._processContent):
Don't wait to lazily clone the `originalRevision` and use it as the `currentRevision`. Some
listeners expect the `currentRevision` to already be set by the time this happens, so as
soon as the original revision's content is changed, clone it into the `currentRevision`.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: tab isn't visible after removal of Debugger Tab and Resources Tab
https://bugs.webkit.org/show_bug.cgi?id=203719
<rdar://problem/56802389>
Reviewed by Timothy Hatcher.
* UserInterface/Base/Main.js:
(WI.loaded):
If the Debugger Tab identifier or Resources Tab identifier still exists in the list of open
tabs, remove both and replace the first one with the Sources Tab identifier.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: make the default content of the Inspector Bootstrap Script a comment that explains how it works
https://bugs.webkit.org/show_bug.cgi?id=203704
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.async createBootstrapScript):
* Localizations/en.lproj/localizedStrings.js:
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: Blackbox: hide icon is missing
https://bugs.webkit.org/show_bug.cgi?id=203727
Reviewed by Timothy Hatcher.
* UserInterface/Images/Hide.svg:
`WI.ImageUtilities.useSVGSymbol` links directly to a specific part of the SVG resource based
on an `id` attribute (default to `#root` if not otherwise given). As a result, any `<style>`
that are not a child of that specific part won't be included, meaning that any CSS variables
used for controlling colors won't exist. Adding a fallback value to the `var()` for these
cases allows a specific part to be used without needing any surrounding styles.
* UserInterface/Views/BlackboxSettingsView.css:
(.settings-view.blackbox > p > .toggle-script-blackbox):
Slightly adjust the size and vertical alignment to better match the surrounding text.
2019-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: enable line wrapping by default
https://bugs.webkit.org/show_bug.cgi?id=203726
Reviewed by Timothy Hatcher.
* UserInterface/Base/Setting.js:
2019-10-31 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Color picker: incorrect saturation when selecting color on color square
https://bugs.webkit.org/show_bug.cgi?id=203695
<rdar://problem/56793697>
Reviewed by Matt Baker.
The saturation component in HSV does NOT equal the saturation component in HSL.
Use the proper HSV to HSL conversion.
* UserInterface/Models/Color.js:
(WI.Color.hsv2hsl): Added.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype.get tintedColor):
(WI.ColorSquare.prototype.get _lightness): Deleted.
2019-10-31 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251038): Elements: Computed: variables are shown in the Properties section instead of in the Variables section
https://bugs.webkit.org/show_bug.cgi?id=203668
Reviewed by Matt Baker.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
* UserInterface/Views/ComputedStyleSection.js:
(WI.ComputedStyleSection):
(WI.ComputedStyleSection.prototype.set propertyVisibilityMode): Added.
(WI.ComputedStyleSection.prototype.get propertiesToRender):
Reintroduce the `propertyVisibilityMode` concept to `WI.ComputedStyleSection` so that the
Computed details panel can prevent CSS variables from being shown in the Properites section.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.get propertiesToRender):
Replace `variable` getter with `isVariable` to match r251038.
2019-10-31 Devin Rousso <drousso@apple.com>
Web Inspector: DOMDebugger: Node Removed breakpoints should fire whenever the node is removed from the main DOM tree, not just when it's removed from it's parent
https://bugs.webkit.org/show_bug.cgi?id=203349
Reviewed by Matt Baker.
Replace `targetNode` (which was a `Runtime.RemoteObject`) with a `targetNodeId` (which is a
`DOM.NodeId`) when dispatching `DOMDebugger` pauses. Additionally, include the ancestor's
`DOM.NodeId` as the `targetNodeId` whenever an ancestor is removed that has a descendant
with a node removed DOM breakpoint.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
* Localizations/en.lproj/localizedStrings.js:
2019-10-31 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: CONSOLE ERROR Shown panel style-rules must be visible
https://bugs.webkit.org/show_bug.cgi?id=203377
Reviewed by Devin Rousso.
Fix assertion failure when opening elements panel with hidden details sidebar.
* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype.showDetailsSidebarPanels):
* UserInterface/Views/Sidebar.js:
(WI.Sidebar.prototype.set selectedSidebarPanel): Only call shown() if the Sidebar
is not collapsed. It will anyway be called when the Sidebar is expanded.
2019-10-30 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: track WI.Script unique display name numbers per Page target
https://bugs.webkit.org/show_bug.cgi?id=203427
Reviewed by Devin Rousso.
WI.Script now keeps track of last unique numbers via a static weak map keyed by
the Script's root target. So whenever new Page target is created all its scripts
will get unique display numbers from a new namespace.
Parent target is now passed to each target constructor and allow to find host
page target for nested targets. Among other things WorkerConnection and
TargetConnection use parentTarget for dispatching events instead of creating
extra copy of the same data that is already stored in Target.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.globalObjectCleared):
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager.prototype.targetCreated):
(WI.TargetManager.prototype.didCommitProvisionalTarget):
(WI.TargetManager.prototype.targetDestroyed):
(WI.TargetManager.prototype.dispatchMessageFromTarget):
(WI.TargetManager.prototype._connectToTarget):
(WI.TargetManager.prototype._createTarget):
* UserInterface/Controllers/WorkerManager.js:
(WI.WorkerManager.prototype.workerCreated):
* UserInterface/Models/Script.js:
(WI.Script):
(WI.Script.prototype.get displayName):
(WI.Script.prototype._nextUniqueDisplayNameNumber):
(WI.Script.prototype._nextUniqueConsoleDisplayNameNumber):
(WI.Script.prototype._uniqueDisplayNameNumbersForRootTarget):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection.prototype.sendMessageToBackend):
(InspectorBackend.WorkerConnection):
(InspectorBackend.TargetConnection.prototype.sendMessageToBackend):
(InspectorBackend.TargetConnection):
* UserInterface/Protocol/DirectBackendTarget.js:
(WI.DirectBackendTarget):
* UserInterface/Protocol/MultiplexingBackendTarget.js:
(WI.MultiplexingBackendTarget):
* UserInterface/Protocol/PageTarget.js:
(WI.PageTarget):
* UserInterface/Protocol/Target.js:
(WI.Target):
(WI.Target.prototype.get parentTarget):
(WI.Target.prototype.get rootTarget):
* UserInterface/Protocol/WorkerTarget.js:
(WI.WorkerTarget):
2019-10-30 Eike Rathke <erack@redhat.com>
Covscan: remove stray semicolon
https://bugs.webkit.org/show_bug.cgi?id=203622
Reviewed by Devin Rousso.
* UserInterface/Views/CheckboxNavigationItem.js:
(WI.CheckboxNavigationItem.prototype.set label):
2019-10-29 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Opacity slider background doesn't update when when hue slider moves
https://bugs.webkit.org/show_bug.cgi?id=203593
<rdar://problem/56723629>
Reviewed by Matt Baker.
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker.prototype.set color):
(WI.ColorPicker.prototype.colorSquareColorDidChange):
Remove unused function arguments.
(WI.ColorPicker.prototype.sliderValueDidChange):
Update the background of the opacity slider when the hue slider changes.
(WI.ColorPicker.prototype._updateOpacitySlider): Renamed from _updateSliders.
Drive-by: replace `var` with `let`.
2019-10-28 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Right-clicking in color picker should not select color
https://bugs.webkit.org/show_bug.cgi?id=203434
Reviewed by Devin Rousso.
* UserInterface/Views/ColorSquare.js:
(WI.ColorSquare.prototype._handleMousedown):
2019-10-28 Antoine Quint <graouts@apple.com>
CSS Transitions and CSS Animations properties should treat unitless 0 as an invalid value for times
https://bugs.webkit.org/show_bug.cgi?id=203484
Reviewed by Antti Koivisto.
Use 0s instead of 0 in places where unitless times were used but shouldn't have been.
* UserInterface/Views/FindBanner.css:
(.no-find-banner-transition:matches(.find-banner, .supports-find-banner)):
* UserInterface/Views/TabBar.css:
(.tab-bar > .item > .close):
2019-10-25 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: un-experimentalize showing rule icons
https://bugs.webkit.org/show_bug.cgi?id=203308
Reviewed by Joseph Pecoraro.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
2019-10-24 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: assertion failure at GeneralStyleDetailsSidebarPanel.js:34:23
https://bugs.webkit.org/show_bug.cgi?id=203376
Reviewed by Devin Rousso.
Use class's prototype instead of class itself when doing instanceof check.
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel):
2019-10-24 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: CONSOLE ERROR removeEventListener cannot remove blackboxed-urls-changed because it doesn't exist.
https://bugs.webkit.org/show_bug.cgi?id=203372
Reviewed by Devin Rousso.
Avoid console errors when opening source panel.
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype._updateSourceCode): Only remove listener if it has
been added before.
2019-10-23 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to inject "bootstrap" JavaScript into the page as the first script executed
https://bugs.webkit.org/show_bug.cgi?id=195847
<rdar://problem/48950551>
Reviewed by Joseph Pecoraro.
When debugging webpages, it's often useful to be able to swizzle various functions in order
to add extra logs for when they're called (e.g. `Event.prototype.preventDefault`). Sometimes
this can be difficult, such as if the page saves a copy of the function and references that
instead, in which case it would be helpful to have a way to guarantee that the swizzled code
is the first thing evaluated after the context is created.
This change adds support for that concept, which has been named Inspector Bootstrap Script.
Once created, it will be injected as the first user script to every new global object that
is created afterwards. Modifications to the Inspector Bootstrap Script take effect for all
new global objects created _after_ the modification happened.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.supportsBootstrapScript): Added.
(WI.NetworkManager.get bootstrapScriptURL): Added.
(WI.NetworkManager.get bootstrapScriptSourceObjectStoreKey): Added.
(WI.NetworkManager.prototype.initializeTarget):
(WI.NetworkManager.prototype.get bootstrapScript): Added.
(WI.NetworkManager.prototype.get bootstrapScriptEnabled): Added.
(WI.NetworkManager.prototype.set bootstrapScriptEnabled): Added.
(WI.NetworkManager.prototype.async createBootstrapScript): Added.
(WI.NetworkManager.prototype.destroyBootstrapScript): Added.
(WI.NetworkManager.prototype._processServiceWorkerConfiguration):
(WI.NetworkManager.prototype._handleBootstrapScriptContentDidChange): Added.
* UserInterface/Models/LocalScript.js:
(WI.LocalScript):
(WI.LocalScript.prototype.get editable): Added.
(WI.LocalScript.prototype.get supportsScriptBlackboxing): Added.
(WI.LocalScript.prototype.requestContentFromBackend):
(WI.LocalScript.prototype.handleCurrentRevisionContentChange): Added.
* UserInterface/Views/ScriptContentView.js:
(WI.ScriptContentView):
(WI.ScriptContentView.prototype._contentWillPopulate):
(WI.ScriptContentView.prototype._contentDidPopulate):
(WI.ScriptContentView.prototype._handleTextEditorContentDidChange): Added.
Support editing of `WI.LocalScript` that are specifically marked as such.
* UserInterface/Models/Script.js:
(WI.Script):
(WI.Script.prototype.get displayName):
(WI.Script.prototype.get displayURL):
(WI.Script.prototype.isMainResource):
(WI.Script.prototype._resolveResource):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch):
(WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator):
(WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator):
Allow a `WI.Script` to not have an associated `WI.Target`, specifically for `WI.LocalScript`.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject):
(WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline):
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._addLocalOverride): Added.
(WI.SourcesNavigationSidebarPanel.prototype._removeResourceOverride): Added.
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu):
(WI.SourcesNavigationSidebarPanel.prototype._handleBootstrapScriptCreated): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleBootstrapScriptDestroyed): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideAdded):
(WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
(WI.SourcesNavigationSidebarPanel.prototype._addLocalResourceOverride): Removed.
(WI.SourcesNavigationSidebarPanel.prototype._removeLocalResourceOverride): Removed.
Add an item in the create resource context menu for creating/focusing the bootstrap script.
* UserInterface/Views/ScriptTreeElement.js:
(WI.ScriptTreeElement):
* UserInterface/Views/BootstrapScriptTreeElement.js: Added.
(WI.BootstrapScriptTreeElement):
(WI.BootstrapScriptTreeElement.prototype.onattach):
(WI.BootstrapScriptTreeElement.prototype.ondetach):
(WI.BootstrapScriptTreeElement.prototype.ondelete):
(WI.BootstrapScriptTreeElement.prototype.onspace):
(WI.BootstrapScriptTreeElement.prototype.canSelectOnMouseDown):
(WI.BootstrapScriptTreeElement.prototype.populateContextMenu):
(WI.BootstrapScriptTreeElement.prototype.updateStatus):
(WI.BootstrapScriptTreeElement.prototype._handleNetworkManagerBootstrapScriptToggled):
* UserInterface/Views/BootstrapScriptTreeElement.css: Added.
(.item.script.bootstrap .status > input[type="checkbox"]):
* UserInterface/Views/LocalResourceOverrideTreeElement.css:
(.item.resource.override .status > input[type="checkbox"]): Added.
(.item.resource.override .status > div): Removed.
Don't show the full bootstrap script URL. Instead, show "Inspector Bootstrap Script".
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype.didPresentDialog):
Show the bootstrap script in the open resource dialog.
* UserInterface/Base/Utilities.js:
(isWebInspectorBootstrapScript): Added.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.scriptDidFail):
* UserInterface/Base/ObjectStore.js:
(WI.ObjectStore.static _open):
(WI.ObjectStore.prototype.async get): Added.
Add a generalized object store that can be used for one-off values that need the larger
storage capacity of `IndexedDB`.
* .eslintrc:
* Localizations/en.lproj/localizedStrings.js:
2019-10-23 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: notify inspector when provisional page is created, committed and destroyed
https://bugs.webkit.org/show_bug.cgi?id=202704
Reviewed by Devin Rousso.
Updated frontend code to understand provisional targets. For now there are
no changes frontend behavior, it will wait for the provisional target to commit
and will not send any commands to it before that.
* UserInterface/Base/Main.js: Moved a bunch of methods shared between Main.js and Test.js
to TargetManager.js to keep them in sync.
* UserInterface/Controllers/TargetManager.js:
(WI.TargetManager):
(WI.TargetManager.prototype.removeTarget):
(WI.TargetManager.prototype.createMultiplexingBackendTarget):
(WI.TargetManager.prototype.createDirectBackendTarget):
(WI.TargetManager.prototype.targetCreated):
(WI.TargetManager.prototype.didCommitProvisionalTarget):
(WI.TargetManager.prototype.targetDestroyed):
(WI.TargetManager.prototype.dispatchMessageFromTarget):
(WI.TargetManager.prototype._checkAndHandlePageTargetTransition):
(WI.TargetManager.prototype._checkAndHandlePageTargetTermination):
(WI.TargetManager.prototype._initializeBackendTarget):
(WI.TargetManager.prototype._initializePageTarget):
(WI.TargetManager.prototype._transitionPageTarget):
(WI.TargetManager.prototype._terminatePageTarget):
(WI.TargetManager.prototype._resetMainExecutionContext):
(WI.TargetManager.prototype._redirectGlobalAgentsToConnection):
* UserInterface/Protocol/Connection.js:
(InspectorBackend.WorkerConnection.sendMessageToBackend):
(InspectorBackend.WorkerConnection):
(InspectorBackend.TargetConnection.sendMessageToBackend):
(InspectorBackend.TargetConnection):
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.destroy): Mark target as destroyed to distinguish expected command errors from
genuine failures.
(WI.Target.prototype.isDestroyed):
* UserInterface/Protocol/TargetObserver.js: Since the front-end doesn't
send commands to the provisional targets yet, it has to ignore all activities
related to provisional pages. For that reason we need two sets to keep track of
- provisional pages that were destroyed and never committed
- old pages which were replaced by committed page and for which following targetDestroyed
event should be ignored
Better support for provisional targets will be added to frontend in a separate change.
(WI.TargetObserver):
(WI.TargetObserver.prototype.targetCreated):
(WI.TargetObserver.prototype.didCommitProvisionalTarget): For now convert the event into a subsequence
of targetDestroyed/targetCreated events which matches previous behavior.
(WI.TargetObserver.prototype.targetDestroyed):
(WI.TargetObserver.prototype.dispatchMessageFromTarget):
* UserInterface/Test/Test.js:
(WI.transitionPageTarget):
(WI.terminatePageTarget):
2019-10-23 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Replace color wheel with square HSB color picker
https://bugs.webkit.org/show_bug.cgi?id=203169
<rdar://problem/56449832>
Reviewed by Devin Rousso.
Replace the color wheel with a square HSB color picker.
The square HSB color picker provides more precision for choosing saturation,
and it's more familiar to most web developers.
* UserInterface/Main.html:
* UserInterface/Views/ColorPicker.css:
(.color-picker):
(.color-picker > .hue):
(body[dir=ltr] .color-picker > .hue):
(body[dir=rtl] .color-picker > .hue):
* UserInterface/Views/ColorPicker.js:
(WI.ColorPicker):
(WI.ColorPicker.prototype.get colorSquare):
(WI.ColorPicker.prototype.set color):
(WI.ColorPicker.prototype.colorSquareColorDidChange):
(WI.ColorPicker.prototype.sliderValueDidChange):
(WI.ColorPicker.prototype._updateColor):
(WI.ColorPicker.prototype._updateSliders):
Add a hue slider. The new color picker has the hue slider instead of the brightness slider.
* UserInterface/Views/ColorSquare.css: Renamed from Source/WebInspectorUI/UserInterface/Views/ColorWheel.css.
(.color-square):
(.color-square > .saturation-gradient):
(.color-square > .lightness-gradient):
(.color-square > .fill):
(.color-square > .crosshair):
* UserInterface/Views/ColorSquare.js: Added.
(WI.ColorSquare):
(WI.ColorSquare.prototype.get element):
(WI.ColorSquare.prototype.set dimension):
(WI.ColorSquare.prototype.get hue):
(WI.ColorSquare.prototype.set hue):
(WI.ColorSquare.prototype.get tintedColor):
(WI.ColorSquare.prototype.set tintedColor):
(WI.ColorSquare.prototype.get rawColor):
(WI.ColorSquare.prototype.handleEvent):
(WI.ColorSquare.prototype.get _saturation):
(WI.ColorSquare.prototype.get _brightness):
(WI.ColorSquare.prototype.get _lightness):
(WI.ColorSquare.prototype._handleMousedown):
(WI.ColorSquare.prototype._handleMousemove):
(WI.ColorSquare.prototype._handleMouseup):
(WI.ColorSquare.prototype._updateColorForMouseEvent):
(WI.ColorSquare.prototype._setCrosshairPosition):
(WI.ColorSquare.prototype._updateBaseColor):
* UserInterface/Views/ColorWheel.js: Removed.
* UserInterface/Views/GradientEditor.js:
(WI.GradientEditor):
2019-10-23 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: frontend tests should clear output before resending results
https://bugs.webkit.org/show_bug.cgi?id=203262
Reviewed by Devin Rousso.
Inspector front-end tests will clear output log before resending teset results. This avoids
race between InspectorTest.testPageDidLoad event and TestPage.addResult calls that may have
already be sent to the new page after navigation. The latter events otherwise would be added
twice.
* UserInterface/Test/FrontendTestHarness.js:
(FrontendTestHarness):
(FrontendTestHarness.prototype.testPageDidLoad):
(FrontendTestHarness.prototype.reloadPage):
(FrontendTestHarness.prototype.reportUnhandledRejection):
(FrontendTestHarness.prototype.reportUncaughtException):
(FrontendTestHarness.prototype._resendResults): Don't resend the results when the page is loaded
first time.
2019-10-22 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: keep the function/object name sticky in the object preview popover
https://bugs.webkit.org/show_bug.cgi?id=203259
Reviewed by Matt Baker.
* UserInterface/Views/SourceCodeTextEditor.css:
(.popover .debugger-popover-content):
(.popover .debugger-popover-content.expandable): Added.
(.popover .debugger-popover-content > .title):
(.popover .debugger-popover-content > .body):
(.popover .debugger-popover-content.formatted): Added.
(.popover .expandable): Deleted.
Use flexbox to ensure that only the function/object body is scrollable.
Adjust the min/max width/height to take less space for smaller objects.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._showPopoverWithFormattedValue):
Wrap formatted values in a `<div>` so we can apply special styling to them.
2019-10-22 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: content of function definition popover sometimes cut off
https://bugs.webkit.org/show_bug.cgi?id=203258
Reviewed by Matt Baker.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
2019-10-22 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Sources: when editing style sheets, the content is sometimes suddenly replaced with the original content of the resource
https://bugs.webkit.org/show_bug.cgi?id=203235
Reviewed by Timothy Hatcher.
Each `WI.CSSStyleSheet` manages it's own state about when it should ignore events from the
backend telling it that it was modified, such as if the frontend caused the update. In these
cases, the `WI.CSSStyleSheet` itself was early-returning, but the `WI.CSSManager` wasn't,
meaning that the `WI.CSSManager` would then override the content even though the specific
`WI.CSSStyleSheet` knows that its content shouldn't update. To compound this issue, the
`WI.CSSManager` updates any `WI.CSSStyleSheet` using a `Throttler`, so any updates would be
further delayed (first by the protocol travel time) by this, leading to the timing based
intermittent issue. `WI.CSSStyleSheet` already exposes when it should be updated or not via
`WI.CSSStyleSheet.prototype.noteContentDidChange`. Rather than have `WI.CSSManager` just
call that function, it should examine the returned boolean to see if it should continue to
process the update, or if the `WI.CSSStyleSheet` knows that it should be ignored.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.styleSheetChanged):
2019-10-21 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251227): Uncaught Exception: undefined is not an object (evaluating 'agent.enable')
https://bugs.webkit.org/show_bug.cgi?id=203208
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/AppController.js:
(WI.AppController.prototype.activateExtraDomains):
2019-10-21 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Provide a flag for technology preview builds
https://bugs.webkit.org/show_bug.cgi?id=203164
<rdar://problem/56202164>
Reviewed by Devin Rousso.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Test/Test.js:
* UserInterface/Base/Main.js:
* UserInterface/Base/Setting.js:
(WI.isTechnologyPreviewBuild):
(WI.arePreviewFeaturesEnabled):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
In non-TechnologyPreview builds, if there are Preview Features provide a
setting switch that can be used to match the TechnologyPreview features.
2019-10-21 Devin Rousso <drousso@apple.com>
Web Inspector: replace all uses of `window.*Agent` with a target-specific call
https://bugs.webkit.org/show_bug.cgi?id=201149
Reviewed by Matt Baker.
Most of these were changed in r251227, but a few appear to have slipped through the cracks.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.debuggerDidResume):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._createTypeTokenAnnotator):
(WI.SourceCodeTextEditor.prototype._createBasicBlockAnnotator):
2019-10-18 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: allow WebKit engineers to edit UserAgent shadow trees
https://bugs.webkit.org/show_bug.cgi?id=203159
Reviewed by Brian Burg.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.initializeTarget):
(WI.DOMManager.supportsEditingUserAgentShadowTrees): Added.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.get editable):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.get editable):
(WI.DOMTreeElement.prototype._startEditingTarget):
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel):
(WI.GeneralStyleDetailsSidebarPanel.prototype._showPanel):
(WI.GeneralStyleDetailsSidebarPanel.prototype._handleNodeChanged): Added.
* UserInterface/Views/StyleDetailsPanel.js:
(WI.StyleDetailsPanel.prototype.get supportsNewRule): Added.
(WI.StyleDetailsPanel.prototype.markAsNeedsRefresh):
(WI.StyleDetailsPanel.prototype.refresh):
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.get supportsNewRule): Added.
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.newRuleButtonClicked):
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.newRuleButtonContextMenu):
Don't show the "Add Rule" button if the selected node is inside a UserAgent shadow tree.
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createEngineeringSettingsView):
2019-10-18 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: $0 is shown for the wrong node when selecting elements in a user agent shadow tree
https://bugs.webkit.org/show_bug.cgi?id=203155
Reviewed by Matt Baker.
Rather than naively using the last selected node (from `WI.TreeOutline`), we should wait
to see if the inspected page's DOM agent allows the selected node to be used as the
inspected node, and if so then to show the `$0`.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.setInspectedNode):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype._handleInspectedNodeChanged): Added.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li.inspected-node > span::after): Added.
(.tree-outline.dom:focus li.inspected-node.selected > span::after): Added.
(.tree-outline.dom.show-last-selected li.last-selected > span::after): Deleted.
(.tree-outline.dom.show-last-selected:focus li.last-selected > span::after): Deleted.
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selectionControllerSelectionDidChange):
2019-10-18 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r251254): Elements: forced pseudo-class indicator isn't visible for selected nodes
https://bugs.webkit.org/show_bug.cgi?id=203158
Reviewed by Matt Baker.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li > :not(.selection-area)): Added.
(.tree-outline.dom li > span): Deleted.
2019-10-17 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: selection shouldn't be dimmed by shadow trees
https://bugs.webkit.org/show_bug.cgi?id=203057
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li .selection-area):
(.tree-outline.dom li > span): Added.
Don't force the `.selection-area` to be behind (`z-index: -1;`) the rest of the content, as
that also puts it behind any `background-color`. Instead, we should make all the content in
every `WI.DOMTreeElement` be above (`z-index: 1;`) the rest of the content, including the
`.selection-area` and any parent's `background-color`.
2019-10-17 Devin Rousso <drousso@apple.com>
Web Inspector: Network: updates when toggling resource caching should be sent to every connected target
https://bugs.webkit.org/show_bug.cgi?id=203025
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Main.js:
(WI._resourceCachingDisabledSettingChanged):
2019-10-17 Devin Rousso <drousso@apple.com>
Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
https://bugs.webkit.org/show_bug.cgi?id=200384
<rdar://problem/53850352>
Reviewed by Joseph Pecoraro.
`InspectorBackend.domains.${domain}` isn't a truly valid way to feature check, as it
indicates what's supported by the WebKit framework underlying whatever's currently being
inspected, not what the current inspection target supports.
As an example, inspecting an iOS `JSContext` will still show `InspectorBackend.domains.DOM`
as the `DOMAgent` is supported by WebKit, even though `JSContext`s have no concept of the
DOM. In this example, however, `window.DOMAgent` would NOT exist, as the `availability`
check for the `DOM` domain wouldn't pass, meaning that the agent never gets connected.
In order to do proper feature checking, `InspectorBackend.domains` needs to be accurate
depending on the debuggable type. Furthermore, each target underneath that debuggable needs
to be able to "choose" what commands/events are supported based on that target's type.
This patch modifies how InspectorBackendCommands.js ties into `InspectorBackend`. Rather
than directly creating an `InspectorBackend.Agent` for each domain, we now create more of a
"blueprint" of the domain, and wait to actually create an `InspectorBackend.Agent` until we
have a `WI.Target` (and therefore an `InspectorBackend.Connection`). Each "concept" of the
protocol now directly maps to an object.
- InspectorBackend.Domain
- InspectorBackend.Command
- InspectorBackend.Event
- InspectorBackend.Dispatcher
When a `WI.Target` is created, it gets the list of `InspectorBackend.Domain` that support
that `WI.Target`'s type (specified in the protocol JSON files) and generates an
`InspectorBackend.Agent` for each, which in turn generates an `InspectorBackend.Callable`
for each supported `InspectorBackend.Command` and instantiates `InspectorBackend.Dispatcher`.
Activating a `InspectorBackend.Domain` means it's visible for `InspectorBackend` feature
checking. This must be done this way for older ITML backends that will still appear as
"JSContext" targets and therefore go through the "extra domains" path. Ideally, the process
of registering a domain should be enough to activate it. <https://webkit.org/b/201150>
Feature checking can now only be done via `hasDomain`, `hasCommand`, and `hasEvent` on
`InspectorBackend` or a specific `WI.Target`, and there are different implications for each:
- `InspectorBackend.hasDomain(DOM)` asks whether the `DOM` domain is supported by the
current debuggable, but says nothing about whether any `WI.Target` support `DOM`.
- `target.hasDomain("DOM")` asks whether the given `target` supports `DOM`, which is
limited by `InspectorBackend.hasDomain("DOM")`.
Now that `InspectorBackend.Agent` is only created by a `WI.Target`, it's no longer valid to
write `window.DOMAgent`, as there is no "global" agent. All protocol logic _must_ go through
a `WI.Target`. <https://webkit.org/b/201149>
Debuggable Types:
- JavaScript (JSC::JSGlobalObject)
- Page (WebCore::Page)
- ServiceWorker (WebCore::ServiceWorkerThreadProxy)
- WebPage (WebKit::WebPageProxy)
Target Types:
- JavaScript (direct connection)
- Page (multi-target connection to any Worker)
- ServiceWorker (direct connection)
- WebPage (multi-target connection to 1+ Page)
- Worker (direct connection, only available for Page debuggables)
* UserInterface/Base/DebuggableType.js:
* UserInterface/Base/TargetType.js: Copied from Source/WebInspectorUI/UserInterface/Base/DebuggableType.js.
* UserInterface/Protocol/Connection.js:
* UserInterface/Protocol/InspectorBackend.js:
* UserInterface/Protocol/ApplicationCacheObserver.js:
* UserInterface/Protocol/CPUProfilerObserver.js:
* UserInterface/Protocol/CSSObserver.js:
* UserInterface/Protocol/CanvasObserver.js:
* UserInterface/Protocol/ConsoleObserver.js:
* UserInterface/Protocol/DOMObserver.js:
* UserInterface/Protocol/DOMStorageObserver.js:
* UserInterface/Protocol/DatabaseObserver.js:
* UserInterface/Protocol/DebuggerObserver.js:
* UserInterface/Protocol/HeapObserver.js:
* UserInterface/Protocol/InspectorObserver.js:
* UserInterface/Protocol/LayerTreeObserver.js:
* UserInterface/Protocol/MemoryObserver.js:
* UserInterface/Protocol/NetworkObserver.js:
* UserInterface/Protocol/PageObserver.js:
* UserInterface/Protocol/RuntimeObserver.js:
* UserInterface/Protocol/ScriptProfilerObserver.js:
* UserInterface/Protocol/TargetObserver.js:
* UserInterface/Protocol/TimelineObserver.js:
* UserInterface/Protocol/WorkerObserver.js:
All observers now extend from `InspectorBackend.Dispatcher` and have a separate instance for
each `InspectorBackend.Agent`, each having their own `_target`.
* UserInterface/Protocol/Target.js:
* UserInterface/Protocol/DirectBackendTarget.js:
* UserInterface/Protocol/JavaScriptContextTarget.js: Removed.
* UserInterface/Protocol/MultiplexingBackendTarget.js:
* UserInterface/Protocol/PageTarget.js:
* UserInterface/Protocol/WorkerTarget.js:
Agents are now created per-target instead of copied from the "global" list. This means that
agents can have a different set of commands/events depending on the associated target.
* UserInterface/Base/Main.js:
* UserInterface/Base/Utilities.js:
* UserInterface/Controllers/AppController.js:
* UserInterface/Controllers/AppControllerBase.js:
* UserInterface/Controllers/ApplicationCacheManager.js:
* UserInterface/Controllers/AuditManager.js:
* UserInterface/Controllers/BreakpointPopoverController.js:
* UserInterface/Controllers/CSSManager.js:
* UserInterface/Controllers/CanvasManager.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Controllers/DOMDebuggerManager.js:
* UserInterface/Controllers/DOMManager.js:
* UserInterface/Controllers/DOMStorageManager.js:
* UserInterface/Controllers/DatabaseManager.js:
* UserInterface/Controllers/DebuggerManager.js:
* UserInterface/Controllers/HeapManager.js:
* UserInterface/Controllers/IndexedDBManager.js:
* UserInterface/Controllers/JavaScriptLogViewController.js:
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
* UserInterface/Controllers/LayerTreeManager.js:
* UserInterface/Controllers/MemoryManager.js:
* UserInterface/Controllers/NetworkManager.js:
* UserInterface/Controllers/RuntimeManager.js:
* UserInterface/Controllers/TargetManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Controllers/WorkerManager.js:
* UserInterface/Main.html:
* UserInterface/Models/AuditTestBase.js:
* UserInterface/Models/AuditTestCase.js:
* UserInterface/Models/AuditTestCaseResult.js:
* UserInterface/Models/CPUInstrument.js:
* UserInterface/Models/CPUTimelineRecord.js:
* UserInterface/Models/CSSCompletions.js:
* UserInterface/Models/CSSStyleSheet.js:
* UserInterface/Models/Canvas.js:
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/DOMNodeStyles.js:
* UserInterface/Models/DOMStorageObject.js:
* UserInterface/Models/DOMTree.js:
* UserInterface/Models/DatabaseObject.js:
* UserInterface/Models/FPSInstrument.js:
* UserInterface/Models/GarbageCollection.js:
* UserInterface/Models/HeapAllocationsInstrument.js:
* UserInterface/Models/Instrument.js:
* UserInterface/Models/MediaInstrument.js:
* UserInterface/Models/MemoryInstrument.js:
* UserInterface/Models/MemoryPressureEvent.js:
* UserInterface/Models/MemoryTimelineRecord.js:
* UserInterface/Models/Recording.js:
* UserInterface/Models/Resource.js:
* UserInterface/Models/ScriptInstrument.js:
* UserInterface/Models/ScriptSyntaxTree.js:
* UserInterface/Models/ScriptTimelineRecord.js:
* UserInterface/Models/ShaderProgram.js:
* UserInterface/Models/SourceMapResource.js:
* UserInterface/Models/TimelineRecording.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Test.html:
* UserInterface/Test/FrontendTestHarness.js:
* UserInterface/Test/Test.js:
* UserInterface/Test/TestAppController.js:
* UserInterface/Views/AuditNavigationSidebarPanel.js:
* UserInterface/Views/AuditTabContentView.js:
* UserInterface/Views/CanvasTabContentView.js:
* UserInterface/Views/ContextMenuUtilities.js:
* UserInterface/Views/CookieStorageContentView.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
* UserInterface/Views/DOMTreeContentView.js:
* UserInterface/Views/ElementsTabContentView.js:
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
* UserInterface/Views/Layers3DContentView.js:
* UserInterface/Views/LayersTabContentView.js:
* UserInterface/Views/LayoutTimelineView.js:
* UserInterface/Views/LogContentView.js:
* UserInterface/Views/NetworkTabContentView.js:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/NetworkTimelineView.js:
* UserInterface/Views/ObjectTreeView.js:
* UserInterface/Views/QuickConsole.js:
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
* UserInterface/Views/ScriptClusterTimelineView.js:
* UserInterface/Views/ScriptDetailsTimelineView.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchSidebarPanel.js:
* UserInterface/Views/SearchTabContentView.js:
* UserInterface/Views/SettingsTabContentView.js:
* UserInterface/Views/SourceCodeTextEditor.js:
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
* UserInterface/Views/SpreadsheetStyleProperty.js:
* UserInterface/Views/StorageTabContentView.js:
* UserInterface/Views/TimelineRecordingContentView.js:
* UserInterface/Views/TimelineTabContentView.js:
* UserInterface/Views/Toolbar.js:
* UserInterface/Views/WebSocketContentView.js:
* UserInterface/Views/WorkerTreeElement.js:
Replace all instances of `window.DomainAgent` with `target.DomainAgent`, where `target` is
either derived from an associated model object or `WI.assumingMainTarget()`.
Split the `WI.DebuggableType.Web` debuggable type into `WI.DebuggableType.Page` (WebCore::Page)
and `WI.DebuggableType.WebPage` (WebKit::WebPageProxy).
* UserInterface/Protocol/Legacy/*:
* Versions/*:
Update protocol files for older versions of iOS.
* .eslintrc:
* Localizations/en.lproj/localizedStrings.js:
2019-10-15 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: prevent source mapped resources from being blackboxed
https://bugs.webkit.org/show_bug.cgi?id=203007
Reviewed by Matt Baker.
Since source mapped resources are entirely a frontend concept, it doesn't make sense to
allow them to be blackboxed.
* UserInterface/Models/SourceMapResource.js:
(WI.SourceMapResource.prototype.get supportsScriptBlackboxing):
2019-10-15 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Convert CSSRule selectorText setter to setSelectorText method because it's asynchronous
https://bugs.webkit.org/show_bug.cgi?id=202840
Reviewed by Matt Baker.
* UserInterface/Models/CSSRule.js:
(WI.CSSRule.prototype.setSelectorText):
(WI.CSSRule.prototype._selectorRejected):
(WI.CSSRule.prototype._selectorResolved):
Remove WI.CSSRule.Event.SelectorChanged event and since it wasn't used anywhere else.
(WI.CSSRule):
(WI.CSSRule.prototype.set selectorText): Deleted.
(WI.CSSRule.prototype.setSelectorText): Added.
(WI.CSSRule.prototype._selectorRejected): Deleted.
(WI.CSSRule.Event.SelectorChanged): Deleted.
Remove `{valid: ...}` object since it wasn't used.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit):
2019-10-15 Devin Rousso <drousso@apple.com>
Web Inspector: Local Resource Overrides: automatically create an image/font local override when dragging content over a non-overridden resource
https://bugs.webkit.org/show_bug.cgi?id=202957
Reviewed by Joseph Pecoraro.
Since non-text resources aren't editable, some users of local resource overrides kept trying
to drag image/font files over the actual resource content view (not the local override),
which didn't do anything. Rather than having to click "Create Local Override" and then do a
drag/drop, we should support the "shorter" workflow of drag/drop over the actual resource.
* UserInterface/Base/FileUtilities.js:
(WI.FileUtilities.import): Added.
(WI.FileUtilities.importText):
(WI.FileUtilities.importJSON):
(WI.FileUtilities.importData): Added.
(WI.FileUtilities.async readText):
(WI.FileUtilities.async readJSON):
(WI.FileUtilities.async readData): Added.
(WI.FileUtilities.async _read): Added.
Create utility functions for importing non-text content as data.
Drive-by: fix a bug in the `import*` functions where the `callback` would be bound on the
first call, meaning that since the `<input>` was cached for all calls, we'd only
ever use the first `callback` in subsequent calls.
* UserInterface/Views/DropZoneView.js:
(WI.DropZoneView):
(WI.DropZoneView.prototype.set text): Added.
Support the text content of the drop zone changing after it's initialized.
* UserInterface/Views/FontResourceContentView.js:
(WI.FontResourceContentView):
(WI.FontResourceContentView.prototype.contentAvailable):
(WI.FontResourceContentView.prototype.dropZoneHandleDragEnter): Added.
(WI.FontResourceContentView.prototype.dropZoneHandleDrop):
(WI.FontResourceContentView.prototype._handleLocalResourceContentDidChange): Added.
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView):
(WI.ImageResourceContentView.prototype.contentAvailable):
(WI.ImageResourceContentView.prototype.dropZoneHandleDragEnter): Added.
(WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
(WI.ImageResourceContentView.prototype._handleLocalResourceContentDidChange): Added.
Support drag/drop on non-override image/font content views, which will create/update the
local resource override for that resource.
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView):
(WI.ResourceContentView.prototype.get navigationItems):
(WI.ResourceContentView.prototype._handleImportLocalResourceOverride): Added.
When viewing a local resource override, add an "Import" navigation item for non-drag/drop
updating of the contents of the local resource override. This is also exposed for text-based
local resource overrides, since drag/drop inserts the contents of the file (if it's text),
which attempts to determine whether the dropped file is text or data based on the MIME type.
* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._handleImportButtonNavigationItemClicked):
* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype._handleImportButtonNavigationItemClicked):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._importHAR):
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype._importButtonNavigationItemClicked):
Explicitly allow multiple files to be imported at the same time.
* UserInterface/Base/BlobUtilities.js:
(WI.BlobUtilities.blobForContent):
Drive-by: remove extra `base64Encoded` argument when calling `decodeBase64ToBlob`, which
caused SVG-based image local resource overrides to show a broken image when
closing and reopening Web Inspector.
* Localizations/en.lproj/localizedStrings.js:
2019-10-14 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r250991): Sources: local resource overrides should be enabled when not in tests
https://bugs.webkit.org/show_bug.cgi?id=202944
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
2019-10-11 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: support pattern blackboxing
https://bugs.webkit.org/show_bug.cgi?id=198855
Reviewed by Timothy Hatcher.
Allow scripts to be blackboxed based on URL patterns (in addition to individual URLs) which
can be extremely useful when trying to step through unminified library/framework code.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.blackboxTypeForSourceCode): Added.
(WI.DebuggerManager.prototype.get blackboxPatterns): Added.
(WI.DebuggerManager.prototype.setShouldBlackboxScript):
(WI.DebuggerManager.prototype.setShouldBlackboxPattern): Added.
(WI.DebuggerManager.prototype.isScriptBlackboxed): Deleted.
Provide a separate path for setting URL pattern blackboxes, rather than an exact/given URL.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView):
(WI.SettingsTabContentView.prototype.selectBlackboxPattern): Added.
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createSourcesSettingsView):
* UserInterface/Views/BlackboxSettingsView.js: Added.
(WI.BlackboxSettingsView):
(WI.BlackboxSettingsView.prototype.selectBlackboxPattern):
(WI.BlackboxSettingsView.prototype.initialLayout):
(WI.BlackboxSettingsView.prototype._addRow):
* UserInterface/Views/BlackboxSettingsView.css: Added.
(.settings-view.blackbox > :matches(p, table)):
(.settings-view.blackbox > p):
(.settings-view.blackbox > * + p):
(.settings-view.blackbox > p:last-child):
(.settings-view.blackbox > p > .toggle-script-blackbox):
(.settings-view.blackbox > table):
(.settings-view.blackbox > table > thead th):
(.settings-view.blackbox > table > tbody td):
(.settings-view.blackbox > table > tbody td:not(.remove-blackbox)):
(.settings-view.blackbox > table :matches(th, td).url):
(.settings-view.blackbox > table > tbody td.url > .CodeMirror):
(.settings-view.blackbox > table :matches(th, td):matches(.case-sensitive, .remove-blackbox)):
(.settings-view.blackbox > table > tbody > tr:not(:hover) > td.remove-blackbox):
(.settings-view.blackbox > table > tbody td.remove-blackbox > .remove-blackbox-button):
Add a "Blackbox" pane that contains an editable table of pattern blackboxes, each having its
own row (code mirror for the URL regular expression and a checkbox for case sensitivity).
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype.updateStatus):
(WI.SourceCodeTreeElement.prototype._updateSourceCode):
(WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState):
(WI.SourceCodeTreeElement.prototype._handleToggleBlackboxedImageElementClicked):
* UserInterface/Views/SourceCodeTreeElement.css:
(.tree-outline .item .status > .toggle-script-blackbox, .tree-outline:focus .item.selected .status > .toggle-script-blackbox.pattern-blackboxed): Added.
(.tree-outline .item .status > .toggle-script-blackbox.pattern-blackboxed): Added.
(.tree-outline .item .status > .toggle-script-blackbox): Added.
(.tree-outline .item .status > .toggle-script-blackbox:not(.pattern-blackboxed)): Added.
(.tree-outline .item .status > .toggle-script-blackbox:not(.url-blackboxed, .pattern-blackboxed)): Added.
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackbox, .tree-outline .item:not(:hover) .status > .toggle-script-blackbox:not(.pattern-blackboxed, .url-blackboxed)): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox.pattern-blackboxed): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackbox:not(.pattern-blackboxed)): Added.
(.tree-outline .item .status > .toggle-script-blackboxed): Deleted.
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed, .tree-outline .item:not(:hover) .status > .toggle-script-blackboxed:not(.blackboxed)): Deleted.
(.tree-outline:focus .item.selected .status > .toggle-script-blackboxed): Deleted.
(.tree-outline .item .status > .toggle-script-blackboxed.blackboxed): Deleted.
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackboxed): Deleted.
* UserInterface/Views/ShaderProgramTreeElement.css:
(.tree-outline .item.shader-program .status > img):
(.tree-outline .item.shader-program:not(:hover, .disabled) .status > img): Added.
(.tree-outline .item.shader-program:not(.disabled) .status > img): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item.shader-program .status > img):
(.tree-outline .item.shader-program:not(:hover, .selected, .disabled) .status > img): Deleted.
(.tree-outline:focus .item.shader-program.selected .status > img): Deleted.
(.tree-outline .item.shader-program.disabled .status > img): Deleted.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* UserInterface/Images/Hide.svg:
Use a slightly different style for the blackbox icon if the source code's URL matches a
blackbox pattern. Clicking on the blackbox icon in this state will show the Settings Tab.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._handleSettingsKeyboardShortcut): Added.
(WI.showSettingsTab): Added.
(WI._showSettingsTab): Deleted.
* Localizations/en.lproj/localizedStrings.js:
2019-10-11 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Computed: show shorthand properties in addition to longhand ones
https://bugs.webkit.org/show_bug.cgi?id=200554
Reviewed by Matt Baker.
Replace the "Show All [ ]" checkbox header option in the "Properties" section with a filter
icon that controls both "Show All" and "Prefer Shorthands", the latter of which will cause
any longhand properties to be hidden and their respective shorthands to be shown.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty):
(WI.CSSProperty.prototype.update):
(WI.CSSProperty.prototype.get isVariable): Added.
(WI.CSSProperty.prototype.get isShorthand): Added.
(WI.CSSProperty.prototype.get shorthandPropertyNames): Added.
(WI.CSSProperty.prototype.get variable): Deleted.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel):
(WI.ComputedStyleDetailsPanel.prototype.applyFilter):
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
(WI.ComputedStyleDetailsPanel.prototype._computedStyleShowAllCheckboxValueChanged): Deleted.
* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content > .computed > .details-section): Added.
(.sidebar > .panel.details.css-style > .content > .computed > .details-section > .content): Added.
(.sidebar > .panel.details.css-style > .content > .computed .spreadsheet-style-declaration-editor): Added.
(.sidebar > .panel.details.css-style > .content > .computed .property): Added.
(.sidebar > .panel.details.css-style > .content > .computed .property .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .property:not(:hover) .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables)): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property .go-to-arrow): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property:not(:hover) .go-to-arrow): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) > .content): Deleted.
* UserInterface/Views/ComputedStyleSection.js:
(WI.ComputedStyleSection):
(WI.ComputedStyleSection.prototype.set showsShorthandsInsteadOfLonghands): Added.
(WI.ComputedStyleSection.prototype.get propertiesToRender):
(WI.ComputedStyleSection.prototype.set propertyVisibilityMode): Deleted.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.update):
(WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens):
* Localizations/en.lproj/localizedStrings.js:
2019-10-10 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Local Resource Overrides: UI for overriding image and font resource content
https://bugs.webkit.org/show_bug.cgi?id=202016
<rdar://problem/55541475>
Reviewed by Devin Rousso.
Extend SourceCodeRevision to be a (content, base64Encoded, mimeType) tuple and
make clients update the revision content more explicitly (`updateRevisionContent`).
This also includes `blobContent` as a more explicit way to get the content as
a Blob, which may not always be desired.
Switch LocalResource use the originalRevision / currentRevision instead of
keeping its own localContent / localContentIsBase64Encoded properties.
Introduce a `DropZoneView` to simplify handling of presenting a drop zone
over a specific element. And use it for the ImageResourceContentView for local
resource overrides to accept new content.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New strings and resources.
* .eslintrc:
* UserInterface/Base/BlobUtilities.js: Added.
(WI.BlobUtilities.blobForContent):
(WI.BlobUtilities.decodeBase64ToBlob):
(WI.BlobUtilities.textToBlob):
(WI.BlobUtilities.blobAsText):
(WI.BlobUtilities):
* UserInterface/Base/FileUtilities.js:
(WI.FileUtilities.async.readDataURL):
(WI.FileUtilities):
* UserInterface/Base/MIMETypeUtilities.js:
(WI.fileExtensionForFilename):
(WI.fileExtensionForURL):
* UserInterface/Base/Utilities.js:
Move around or introduce some minor utilities.
* UserInterface/Models/SourceCodeRevision.js:
(WI.SourceCodeRevision):
(WI.SourceCodeRevision.prototype.get sourceCode):
(WI.SourceCodeRevision.prototype.get content):
(WI.SourceCodeRevision.prototype.get base64Encoded):
(WI.SourceCodeRevision.prototype.get mimeType):
(WI.SourceCodeRevision.prototype.get blobContent):
(WI.SourceCodeRevision.prototype.updateRevisionContent):
(WI.SourceCodeRevision.prototype.copy):
(WI.SourceCodeRevision.prototype.set content): Deleted.
Data is now a (content, base64Encoded, mimeType) tuple.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.responseIntercepted):
(WI.NetworkManager.prototype._handleResourceContentDidChange):
(WI.NetworkManager.prototype._persistLocalResourceOverrideSoonAfterContentChange): Deleted.
This is now a unified resource content change path without anything special for
local resource overrides.
* UserInterface/Models/LocalResource.js:
(WI.LocalResource.prototype.toJSON):
(WI.LocalResource.prototype.requestContentFromBackend):
(WI.LocalResource.prototype.handleCurrentRevisionContentChange):
(WI.LocalResource):
(WI.LocalResource.prototype.get localContent): Deleted.
(WI.LocalResource.prototype.get localContentIsBase64Encoded): Deleted.
(WI.LocalResource.prototype.hasContent): Deleted.
(WI.LocalResource.prototype.setContent): Deleted.
(WI.LocalResource.prototype.updateOverrideContent): Deleted.
Use originalRevision / currentRevision as appropriate.
* UserInterface/Views/DropZoneView.css: Added.
(.drop-zone):
(.drop-zone.visible):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/DropZoneView.js: Added.
(WI.DropZoneView):
(WI.DropZoneView.prototype.get delegate):
(WI.DropZoneView.prototype.get targetElement):
(WI.DropZoneView.prototype.set targetElement):
(WI.DropZoneView.prototype.initialLayout):
(WI.DropZoneView.prototype._startActiveDrag):
(WI.DropZoneView.prototype._stopActiveDrag):
(WI.DropZoneView.prototype._handleDragEnter):
(WI.DropZoneView.prototype._handleDragLeave):
(WI.DropZoneView.prototype._handleDragOver):
(WI.DropZoneView.prototype._handleDrop):
Simplified handling of a drop zone.
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype.removeLoadingIndicator):
More safely remove children and subviews.
(WI.ResourceContentView):
(WI.ResourceContentView.prototype.get resource):
(WI.ResourceContentView.prototype.get navigationItems):
(WI.ResourceContentView.prototype.localResourceOverrideInitialContent):
(WI.ResourceContentView.prototype.closed):
(WI.ResourceContentView.prototype.removeLoadingIndicator):
(WI.ResourceContentView.prototype._contentAvailable):
(WI.ResourceContentView.prototype._issueWasAdded):
(WI.ResourceContentView.prototype.async._handleCreateLocalResourceOverride):
(WI.ResourceContentView.prototype._handleRemoveLocalResourceOverride):
(WI.ResourceContentView.prototype._handleLocalResourceOverrideChanged):
(WI.ResourceContentView.prototype._mouseWasClicked):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView):
(WI.TextResourceContentView.prototype.get navigationItems):
(WI.TextResourceContentView.prototype.localResourceOverrideInitialContent):
(WI.TextResourceContentView.prototype._contentWillPopulate):
(WI.TextResourceContentView.prototype._contentDidPopulate):
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
(WI.TextResourceContentView.prototype._shouldBeEditable):
(WI.TextResourceContentView.prototype.async._handleCreateLocalResourceOverride): Deleted.
(WI.TextResourceContentView.prototype._handleRemoveLocalResourceOverride): Deleted.
(WI.TextResourceContentView.prototype._handleLocalResourceOverrideChanged): Deleted.
Extract generalized local resource override properties into the ResourceContentView base class.
* UserInterface/Views/FontResourceContentView.css:
(.content-view.resource.font):
(.content-view.resource.font > .drop-zone):
(.content-view.resource.font > .preview-container):
(.content-view.resource.font .preview):
* UserInterface/Views/FontResourceContentView.js:
(WI.FontResourceContentView):
(WI.FontResourceContentView.prototype.contentAvailable):
(WI.FontResourceContentView.prototype.shown):
(WI.FontResourceContentView.prototype.hidden):
(WI.FontResourceContentView.prototype.closed):
(WI.FontResourceContentView.prototype.layout):
(WI.FontResourceContentView.prototype._updatePreviewElement.createMetricElement):
(WI.FontResourceContentView.prototype._updatePreviewElement):
(WI.FontResourceContentView.prototype.dropZoneShouldAppearForDragEvent):
(WI.FontResourceContentView.prototype.dropZoneHandleDrop):
Create a drop zone that will update the font local resource override content.
* UserInterface/Views/ImageResourceContentView.css:
(.content-view.resource.image):
(.content-view.resource.image > .drop-zone):
(.content-view.resource.image > .img-container):
(.content-view.resource.image img):
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView):
(WI.ImageResourceContentView.prototype.get navigationItems):
(WI.ImageResourceContentView.prototype.contentAvailable):
(WI.ImageResourceContentView.prototype.closed):
(WI.ImageResourceContentView.prototype.dropZoneShouldAppearForDragEvent):
(WI.ImageResourceContentView.prototype.dropZoneHandleDrop):
Create a drop zone that will update the image local resource override content.
* UserInterface/Models/Script.js:
(WI.Script.prototype.get mimeType):
Seems like this should have a default value given there may not be a resource.
* UserInterface/Views/LocalResourceOverridePopover.js:
(WI.LocalResourceOverridePopover.prototype.show):
Better handling here, since the utilities expects a number not a string.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.createObjectURL):
* UserInterface/Views/LocalResourceOverrideTreeElement.js:
(WI.LocalResourceOverrideTreeElement.prototype.willDismissPopover):
Use currentRevision more appropriately.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype._processContent):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges):
(WI.CSSManager.prototype._resourceContentDidChange):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
Update revision content more explicitly.
2019-10-10 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: enable tab by default
https://bugs.webkit.org/show_bug.cgi?id=202341
Reviewed by Joseph Pecoraro.
The experimental Sources Tab has progressed enough that it can be enabled by default. There
are some new features that are only available in the Sources Tab that are also ready to be
used (e.g. local resource overrides).
* UserInterface/Main.html:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Base/Setting.js:
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.showResources):
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.supportsLocalResourceOverrides):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForURL):
* UserInterface/Views/DefaultDashboardView.js:
(WI.DefaultDashboardView.prototype._resourcesItemWasClicked):
* UserInterface/Views/RecordingActionTreeElement.js:
(WI.RecordingActionTreeElement.prototype.populateContextMenu):
* UserInterface/Views/SearchResultTreeElement.js:
(WI.SearchResultTreeElement.prototype.populateContextMenu):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu):
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/SourcesTabContentView.js:
(WI.SourcesTabContentView.isTabAllowed): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.css: Removed.
* UserInterface/Views/DebuggerSidebarPanel.js: Removed.
* UserInterface/Views/DebuggerTabContentView.js: Removed.
* UserInterface/Views/ResourceSidebarPanel.css: Removed.
* UserInterface/Views/ResourceSidebarPanel.js: Removed.
* UserInterface/Views/ResourcesTabContentView.js: Removed.
Remove the experimental setting, as well as code for the Resources Tab and the Debugger Tab.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
2019-10-09 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r250948): Web Inspector: Styles: CSS selector becomes gray after stopping editing without modifying it
https://bugs.webkit.org/show_bug.cgi?id=202781
Reviewed by Matt Baker.
When not editing, CSS selectors that match the selected node are highlighted (black in the light mode,
white in the dark mode). When editing starts, span elements that provide highlighting get removed.
When editing stops, active selectors should get highlighted.
r250948 stopped calling `_renderSelector` when selector wasn't modified.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit):
* UserInterface/Views/SpreadsheetSelectorField.js:
(WI.SpreadsheetSelectorField.prototype._handleBlur):
2019-10-09 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Modifying CSS selector by pressing Enter or Tab causes 2 CSS.setRuleSelector backend calls
https://bugs.webkit.org/show_bug.cgi?id=202769
<rdar://problem/56132166>
Reviewed by Matt Baker.
Previously, spreadsheetSelectorFieldDidChange would get called twice:
1. On Enter or Tab key press.
2. On blur event.
With this patch, it only gets called on blur event.
* UserInterface/Models/CSSRule.js:
(WI.CSSRule.prototype.set selectorText):
Remove dead code. Calling `_selectorResolved(true)` would cause an uncaught exception.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidChange): Removed.
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidCommit): Added.
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldWillNavigate): Added.
Split spreadsheetSelectorFieldDidChange into spreadsheetSelectorFieldDidCommit and spreadsheetSelectorFieldWillNavigate.
* UserInterface/Views/SpreadsheetSelectorField.js:
(WI.SpreadsheetSelectorField):
(WI.SpreadsheetSelectorField.prototype.startEditing):
(WI.SpreadsheetSelectorField.prototype.stopEditing):
(WI.SpreadsheetSelectorField.prototype._handleBlur):
(WI.SpreadsheetSelectorField.prototype._handleKeyDown):
Add `_valueBeforeEditing` to check if the value was modified before the blur event.
Similar logic exists in SpreadsheetTextField.
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: modifications to shader modules can be shared between vertex/fragment shaders
https://bugs.webkit.org/show_bug.cgi?id=202031
Reviewed by Dean Jackson.
If the vertex and fragment shaders share the same source module for a WebGPU shader pipeline,
only display a single editable content view for that shader pipeline in the Canvas Tab.
* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.prototype.get sharesVertexFragmentShader): Added.
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.programCreated):
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.programCreated):
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype._refreshContent):
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader.compute, .content-view.shader-program > .shader.vertex.shares-vertex-fragment-shader): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex:not(.shares-vertex-fragment-shader), body[dir=rtl] .content-view.shader-program > .shader.fragment): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment, body[dir=rtl] .content-view.shader-program > .shader.vertex:not(.shares-vertex-fragment-shader)): Added.
(.content-view.shader-program > .shader.compute): Deleted.
(body[dir=ltr] .content-view.shader-program > .shader.vertex, body[dir=rtl] .content-view.shader-program > .shader.fragment): Deleted.
(body[dir=ltr] .content-view.shader-program > .shader.fragment, body[dir=rtl] .content-view.shader-program > .shader.vertex): Deleted.
* UserInterface/Views/CodeMirrorAdditions.js:
Replace the vertex/fragment specific MIME types with a more general "render" MIME type.
* Localizations/en.lproj/localizedStrings.js:
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: make it more obvious that the cards in the overview are clickable
https://bugs.webkit.org/show_bug.cgi?id=202680
Reviewed by Matt Baker.
Add a slight darkening (or lightening when in dark mode) of the background behind the
content preview in the overview.
* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview .content-view.canvas):
(.content-view.canvas-overview .content-view.canvas, .content-view.canvas-overview .content-view.canvas > .preview > img): Added.
(.content-view.canvas-overview .content-view.canvas.recording-active > .progress-view, .content-view.canvas-overview .content-view.canvas > .preview):
(.content-view.canvas-overview .content-view.canvas.recording-active > .progress-view:hover, .content-view.canvas-overview .content-view.canvas > .preview:hover): Added.
(@media (prefers-color-scheme: dark) .content-view.canvas-overview .content-view.canvas, .content-view.canvas-overview .content-view.canvas > .preview > img): Added.
(@media (prefers-color-scheme: dark) .content-view.canvas-overview .content-view.canvas.recording-active > .progress-view:hover, .content-view.canvas-overview .content-view.canvas > .preview:hover): Added.
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: don't show an empty preview for WebGPU devices
https://bugs.webkit.org/show_bug.cgi?id=202679
Reviewed by Matt Baker.
`HTMLCanvasElement.prototype.toDataURL` hasn't been hooked up for `GPUCanvasContext` yet, so
calling `Canvas.requestContent` with a `WebGPUDevice` won't give us any good results.
As such, the Web Inspector frontend should show something slightly more actionable, such as
a more generic non-error "No Preview Available" message.
* UserInterface/Models/Canvas.js:
(WI.Canvas.supportsRequestContentForContextType): Added.
(WI.Canvas.prototype.requestContent):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype._showError):
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: unable to click on overview path component when jumping directly to a shader
https://bugs.webkit.org/show_bug.cgi?id=202682
Reviewed by Matt Baker.
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView):
The `WI.TreeOutline` used for the hierarchical path components is actually held by the
Canvas Tab, not the Canvas navigation sidebar panel. As a result, if the hierarchical path
is changed by anything other than the hierarchical path itself (e.g. a selection in the
navigation sidebar, or clicking on the [gl] shader or [o_o] recording buttons in the
overview preview tile), the selection state of the `WI.TreeOutline` can get out of sync. In
this case, the `WI.TreeOutline` still thinks that "Overview" is selected because the change
in content view was triggered by something unrelated to the `WI.TreeOutline` (see above for
specific examples). The simple solution is to just allow repeat selection, as this is only
an issue here because the canvas navigation sidebar isn't always visible, as well as to
allow the "Overview" to be listed as the root path item.
* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype.updateRepresentedObjects):
If a `WI.Canvas` is one of the current represented objects, attempt to select it, even if
it matches the currently shown `WI.Canvas`. This covers the situation where the `WI.Canvas`
is selected via its hierarchical path component, ensuring that the selected item in the
navigation sidebar always matches the hierarchical path components.
2019-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: the navigation sidebar icon isn't inverted in dark mode
https://bugs.webkit.org/show_bug.cgi?id=202681
Reviewed by Matt Baker.
* UserInterface/Views/CanvasSidebarPanel.css:
(@media (prefers-color-scheme: dark) .sidebar > .panel.navigation.canvas > .content > .tree-outline .item.canvas .icon): Added.
* UserInterface/Views/CanvasTabContentView.css:
(@media (prefers-color-scheme: dark) .content-view.tab.canvas .navigation-bar > .item .canvas-overview .icon):
Drive-by: slightly darken the Canvas Overview hierarchical path component icon so it better
matches the colors of the nearby canvas icons.
2019-10-07 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: enable the image transparency grid by default and create a checkbox for it
https://bugs.webkit.org/show_bug.cgi?id=202678
Reviewed by Matt Baker.
* UserInterface/Base/Setting.js:
Enable the "Show transparency grid" setting by default.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createSourcesSettingsView):
Add a checkbox for "Show transparency grid" in the "Sources" pane.
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView):
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView):
* UserInterface/Views/ImageResourceContentView.js:
(WI.ImageResourceContentView):
* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView):
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView):
* Localizations/en.lproj/localizedStrings.js:
Unify the tooltip string for all of the "Show transparency grid" navigation items.
2019-10-07 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: don't allow blackboxing of scripts that aren't finished loading or failed to load
https://bugs.webkit.org/show_bug.cgi?id=202376
Reviewed by Matt Baker.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get supportsScriptBlackboxing):
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype.updateStatus):
2019-10-02 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: for rules that don't match selected node, property values always show as invalid
https://bugs.webkit.org/show_bug.cgi?id=201571
Reviewed by Matt Baker.
The gist of the bug:
- WI.CSSProperty is instantiated with `valid` false.
- CSSAgent.getMatchedStylesForNode never updates WI.CSSProperty instances because
the edited style does not in fact match the selected DOM node. A valid CSS property
is shown as invalid.
To resolve this, WI.CSSProperty instances are now updated after editing
in the callback of `CSSAgent.setStyleText`.
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype.changeStyleText):
(WI.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
Don't store `style` in `this._stylesMap` of WI.DOMNodeStyles when the style doesn't match the selected node.
2019-10-02 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r250149): changing CSS via the Styles details sidebar panel doesn't update the associated resource
https://bugs.webkit.org/show_bug.cgi?id=202446
Reviewed by Joseph Pecoraro.
When updating the text of a `WI.CSSProperty` (or the selector of a `WI.CSSRule`) is updated,
Web Inspector will update the backend style sheet, which will notify the `WI.CSSManager` of
the change, without ever going through the associated `WI.SourceCode`. `WI.CSSManager` then
updates the content of the `WI.SourceCode` to reflect these changes, but at that point the
`WI.SourceCode` hadn't yet "moved" it's `currentRevision` forward of it's `originalRevision`
which means it would get overridden the first time the `WI.SourceCode` updates itself.
Modify `WI.SourceCode` such that every path to get the `currentRevision` ensures that it is
"moved" forward before the `WI.SourceCodeRevision` value is returned.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get currentRevision):
(WI.SourceCode.prototype.get content):
(WI.SourceCode.prototype.revisionContentDidChange):
(WI.SourceCode.prototype._initializeCurrentRevisionIfNeeded): Added.
(WI.SourceCode.prototype._processContent):
2019-10-01 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: clicking on a breakpoint changes the path components to not match the script's path
https://bugs.webkit.org/show_bug.cgi?id=196450
<rdar://problem/49488100>
Reviewed by Matt Baker.
When selecting any tree element that isn't in the resources tree outline, attempt to find
the corresponding tree element in the resources tree outline and silently select that as
well so that the hierarchical path component shows the right breadcrumb trail.
If the tree element is for a `WI.Script` which has a corresponding `WI.Resource`, use the
`WI.Resource` instead.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
2019-09-30 Devin Rousso <drousso@apple.com>
Web Inspector: JS Formatter: unexpected newlines added inside template string expression
https://bugs.webkit.org/show_bug.cgi?id=202374
Reviewed by Joseph Pecoraro.
Wrap every "add newline" with a check to see if the current node is inside a template
literal node. If so (and we aren't forcibly adding a newline), prevent the newline from
being added.
* UserInterface/Workers/Formatter/JSFormatter.js:
(JSFormatter.prototype._appendNewline): Added.
(JSFormatter.prototype._insertNewlinesBeforeToken):
(JSFormatter.prototype._insertComment):
(JSFormatter.prototype._insertSameLineTrailingComments):
(JSFormatter.prototype._insertCommentsAndNewlines):
(JSFormatter.prototype._before):
(JSFormatter.prototype._after):
(JSFormatter.prototype._handleTokenAtNode):
(JSFormatter.prototype._exitNode):
(JSFormatter.prototype._afterProgram):
2019-09-30 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: shader type header is white in dark mode
https://bugs.webkit.org/show_bug.cgi?id=202253
Reviewed by Matt Baker.
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader > header > .shader-type):
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Deleted.
(.content-view.shader-program > .shader > header > *): Deleted.
2019-09-26 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Include LocalResourceOverrides in the Open Resource dialog
https://bugs.webkit.org/show_bug.cgi?id=202023
Reviewed by Devin Rousso.
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
Also walk the extraScriptCollection. Some Worker resource loads never
fully become resources.
(WI.OpenResourceDialog.prototype.didPresentDialog):
(WI.OpenResourceDialog.prototype._addLocalResourceOverrides):
Include local resource override resources.
(WI.OpenResourceDialog.prototype._populateResourceTreeOutline):
* Localizations/en.lproj/localizedStrings.js:
Include a subtitle for local resource overrides.
* UserInterface/Views/OpenResourceDialog.css:
(.open-resource-dialog .tree-outline.large .item .titles .subtitle):
Improved subtitle styling.
2019-09-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: REGRESSION: Elements detail sidebar sometimes starts collapsed
https://bugs.webkit.org/show_bug.cgi?id=202057
<rdar://problem/55572345>
Reviewed by Devin Rousso.
* UserInterface/Views/ElementsTabContentView.js:
(WI.ElementsTabContentView.prototype.get detailsSidebarExpandedByDefault):
Default the Elements tab detail sidebar to be shown, not collapsed.
* UserInterface/Views/TabContentView.js:
(WI.TabContentView):
(WI.TabContentView.prototype.get detailsSidebarExpandedByDefault):
Allow classes to specify whether or not their detail sidebar should
be expanded by default.
2019-09-25 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'WI.showDebugUISetting.addEventListener')
https://bugs.webkit.org/show_bug.cgi?id=202220
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
2019-09-23 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: WebGPU compute shaders aren't syntax highlighted
https://bugs.webkit.org/show_bug.cgi?id=202030
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CodeMirrorAdditions.js:
`CodeMirror.defineMIME` expects a "spec" object, which can't just be another MIME type.
Instead, get the "spec" of the defined "x-shader/x-vertex" and "x-shader/x-fragment" modes
and use that when defining MIMEs for the WebGPU shader pipeline modes.
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
Get the `contextType` off of the shader's canvas, which is where it actually lives.
2019-09-23 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: show WebGPU shader pipelines
https://bugs.webkit.org/show_bug.cgi?id=201675
<rdar://problem/55543450>
Reviewed by Joseph Pecoraro.
Show WebGPU shader pipelines ("programs") underneath each corresponding WebGPU device.
Allow editing of attached shader modules for each WebGPU shader pipeline, but don't allow
highlighting/disabling, as WebGPU pipelines don't have those capabilities/concepts yet.
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.programCreated):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.programCreated):
* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.nextShaderProgramDisplayNumberForProgramType): Added.
(WI.Canvas.prototype.nextShaderProgramDisplayNumber): Deleted.
* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.contextTypeSupportsProgramType): Added.
(WI.ShaderProgram.programTypeSupportsShaderType): Added.
(WI.ShaderProgram.prototype.get programType): Added.
(WI.ShaderProgram.prototype.get displayName):
(WI.ShaderProgram.prototype.set disabled):
(WI.ShaderProgram.prototype.requestShaderSource):
(WI.ShaderProgram.prototype.updateShader):
(WI.ShaderProgram.prototype.showHighlight):
(WI.ShaderProgram.prototype.hideHighlight):
(WI.ShaderProgram.prototype.requestVertexShaderSource): Deleted.
(WI.ShaderProgram.prototype.requestFragmentShaderSource): Deleted.
(WI.ShaderProgram.prototype.updateVertexShader): Deleted.
(WI.ShaderProgram.prototype.updateFragmentShader): Deleted.
(WI.ShaderProgram.prototype._requestShaderSource): Deleted.
(WI.ShaderProgram.prototype._updateShader): Deleted.
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.get navigationItems): Added.
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype.get saveData):
(WI.ShaderProgramContentView.prototype._refreshContent):
(WI.ShaderProgramContentView.prototype._updateShader):
(WI.ShaderProgramContentView.prototype._contentDidChange):
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader): Added.
(.content-view.shader-program > .shader.compute): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex,): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment,): Added.
(.content-view.shader-program > .shader + .shader): Added.
(.content-view.shader-program > .shader > header > *): Added.
(.content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Added.
(.content-view.shader-program > .text-editor.shader): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.vertex,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.fragment,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(body[dir=rtl] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(.content-view.shader-program > .text-editor.shader > .type-title): Deleted.
(.content-view.shader-program > .text-editor.shader > .CodeMirror): Deleted.
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement):
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach):
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu):
* Localizations/en.lproj/localizedStrings.js:
2019-09-23 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Improve the Uncaught Exception View file a bug link
https://bugs.webkit.org/show_bug.cgi?id=201717
Reviewed by Devin Rousso.
* UserInterface/Debug/UncaughtExceptionReporter.js:
Allow the link to be clicked. Use openInNewTab on click to also
bring the new tab to the foreground. Also update the content.
2019-09-20 Devin Rousso <drousso@apple.com>
Web Inspector: HTML Formatter - better indentation/newline handling for self closing tags
https://bugs.webkit.org/show_bug.cgi?id=202036
Reviewed by Joseph Pecoraro.
* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.prototype._before):
2019-09-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove BranchManager in favor of just using currentRevision
https://bugs.webkit.org/show_bug.cgi?id=202000
Reviewed by Devin Rousso.
Remove BranchManager. The Branch concept never got fleshed out, and would
likely be too complex for the average case. Local Overrides are simpler.
In the interest of expanding Local Overrides to more content lets simply
by removing Branches.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WI.loaded):
* UserInterface/Controllers/BranchManager.js: Removed.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges.styleSheetFound):
(WI.CSSManager.prototype._resourceContentDidChange.applyStyleSheetChanges):
(WI.CSSManager.prototype._resourceContentDidChange):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
* UserInterface/Main.html:
* UserInterface/Models/Branch.js: Removed.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype._processContent):
(WI.SourceCode):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
2019-09-20 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r250114.
Broke ~16 webgpu/ tests on Mojave wk2
Reverted changeset:
"Web Inspector: Canvas: show WebGPU shader pipelines"
https://bugs.webkit.org/show_bug.cgi?id=201675
https://trac.webkit.org/changeset/250114
2019-09-19 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: searching in overrides doesn't work
https://bugs.webkit.org/show_bug.cgi?id=202020
Reviewed by Devin Rousso.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch):
Do not go to agents for a local resource. Search locally in the TextEditor.
2019-09-19 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: show WebGPU shader pipelines
https://bugs.webkit.org/show_bug.cgi?id=201675
Reviewed by Joseph Pecoraro.
Show WebGPU shader pipelines ("programs") underneath each corresponding WebGPU device.
Allow editing of attached shader modules for each WebGPU shader pipeline, but don't allow
highlighting/disabling, as WebGPU pipelines don't have those capabilities/concepts yet.
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.programCreated):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.programCreated):
* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.nextShaderProgramDisplayNumberForProgramType): Added.
(WI.Canvas.prototype.nextShaderProgramDisplayNumber): Deleted.
* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.contextTypeSupportsProgramType): Added.
(WI.ShaderProgram.programTypeSupportsShaderType): Added.
(WI.ShaderProgram.prototype.get programType): Added.
(WI.ShaderProgram.prototype.get displayName):
(WI.ShaderProgram.prototype.set disabled):
(WI.ShaderProgram.prototype.requestShaderSource):
(WI.ShaderProgram.prototype.updateShader):
(WI.ShaderProgram.prototype.showHighlight):
(WI.ShaderProgram.prototype.hideHighlight):
(WI.ShaderProgram.prototype.requestVertexShaderSource): Deleted.
(WI.ShaderProgram.prototype.requestFragmentShaderSource): Deleted.
(WI.ShaderProgram.prototype.updateVertexShader): Deleted.
(WI.ShaderProgram.prototype.updateFragmentShader): Deleted.
(WI.ShaderProgram.prototype._requestShaderSource): Deleted.
(WI.ShaderProgram.prototype._updateShader): Deleted.
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView):
(WI.ShaderProgramContentView.prototype.get navigationItems): Added.
(WI.ShaderProgramContentView.prototype.shown):
(WI.ShaderProgramContentView.prototype.hidden):
(WI.ShaderProgramContentView.prototype.get saveData):
(WI.ShaderProgramContentView.prototype._refreshContent):
(WI.ShaderProgramContentView.prototype._updateShader):
(WI.ShaderProgramContentView.prototype._contentDidChange):
* UserInterface/Views/ShaderProgramContentView.css:
(.content-view.shader-program > .shader): Added.
(.content-view.shader-program > .shader.compute): Added.
(body[dir=ltr] .content-view.shader-program > .shader.vertex,): Added.
(body[dir=ltr] .content-view.shader-program > .shader.fragment,): Added.
(.content-view.shader-program > .shader + .shader): Added.
(.content-view.shader-program > .shader > header > *): Added.
(.content-view.shader-program > .shader > header > .shader-type): Added.
(@media (prefers-color-scheme: dark) .content-view.shader-program > .shader > header): Added.
(.content-view.shader-program > .text-editor.shader): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.vertex,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader.fragment,): Deleted.
(body[dir=ltr] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(body[dir=rtl] .content-view.shader-program > .text-editor.shader + .text-editor.shader): Deleted.
(.content-view.shader-program > .text-editor.shader > .type-title): Deleted.
(.content-view.shader-program > .text-editor.shader > .CodeMirror): Deleted.
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement):
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach):
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu):
* Localizations/en.lproj/localizedStrings.js:
2019-09-18 Devin Rousso <drousso@apple.com>
Web Inspector: Better handling for large arrays and collections in Object Trees
https://bugs.webkit.org/show_bug.cgi?id=143589
<rdar://problem/16135388>
Reviewed by Joseph Pecoraro.
Adds two buttons before the "Prototype" item in expanded object/collection previews:
- Show %d More
- Show All (%d More)
The default `fetchCount` increment is `100`. The first button will only be shown if there
are more than `100` items remaining (haven't been shown).
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.getPropertyDescriptors):
(WI.RemoteObject.prototype.getDisplayablePropertyDescriptors):
(WI.RemoteObject.prototype.getCollectionEntries):
(WI.RemoteObject.prototype.getOwnPropertyDescriptor.wrappedCallback):
(WI.RemoteObject.prototype._getProperties): Added.
(WI.RemoteObject.prototype._getDisplayableProperties): Added.
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView):
(WI.ObjectTreeView.showMoreFetchCount): Added.
(WI.ObjectTreeView.addShowMoreIfNeeded): Added.
(WI.ObjectTreeView.prototype.update):
(WI.ObjectTreeView.prototype._updateChildren):
(WI.ObjectTreeView.prototype._updateEntries):
(WI.ObjectTreeView.prototype._updateProperties):
* UserInterface/Views/ObjectTreeView.css:
(.tree-outline.object li > button[disabled] + .indeterminate-progress-spinner): Added.
Avoid duplicating the button creation logic in `WI.ObjectTreePropertyTreeElement` by using a
`static` function. This expects the existence of and requires access to "private" values.
* UserInterface/Views/ObjectTreePropertyTreeElement.js:
(WI.ObjectTreePropertyTreeElement):
(WI.ObjectTreePropertyTreeElement.prototype.onpopulate):
(WI.ObjectTreePropertyTreeElement.prototype._updateChildren):
(WI.ObjectTreePropertyTreeElement.prototype._updateEntries):
(WI.ObjectTreePropertyTreeElement.prototype._updateProperties):
(WI.ObjectTreePropertyTreeElement.prototype._updateChildrenInternal): Deleted.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedArrayPropertyNames): Deleted.
* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager.prototype.getPropertiesForRemoteObject): Deleted.
Remove unused function.
* Localizations/en.lproj/localizedStrings.js:
2019-09-18 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: console assertion when pressing up/down in empty console log view
https://bugs.webkit.org/show_bug.cgi?id=201948
Reviewed by Devin Rousso.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._upArrowWasPressed):
(WI.LogContentView.prototype._downArrowWasPressed):
Ensure that a message exists before calling `_updateMessagesSelection`, which
would assert if given a bad message. Additionally, only perform preventDefault
when selecting a message. This allows us to fall back to a system beep if
this key event does nothing.
2019-09-17 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: HTML Formatter - better handling for HTML specific tag cases (<p>/<li>)
https://bugs.webkit.org/show_bug.cgi?id=201757
<rdar://problem/55409987>
Reviewed by Devin Rousso.
* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.prototype._after):
Handle a closing tag with different text than the opening tag.
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js:
(HTMLTreeBuilderFormatter.prototype._pushParserNodeTopLevel):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeStack):
(HTMLTreeBuilderFormatter.prototype._implicitlyCloseHTMLNodesForOpenTag):
(HTMLTreeBuilderFormatter.prototype._implicitlyCloseTagNamesInsideParentTagNames):
(HTMLTreeBuilderFormatter.prototype._indexOfStackNodeMatchingTagNames):
Generalize the implicit closing a bit. Allow open tags to implicitly
close certain other open tags in the stack.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: HTML Formatter - XML mode
https://bugs.webkit.org/show_bug.cgi?id=201758
Reviewed by Devin Rousso.
* Tools/HTMLFormatter/index.html:
* Tools/SourceMaps/index.html:
Update Tools to more easily test XML.
* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatXML):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.hasFormatter):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
Allow formatting XML content.
* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatHTML):
(FormatterWorker.prototype.formatXML):
Expose "formatXML".
* UserInterface/Workers/Formatter/HTMLFormatter.js:
(HTMLFormatter.let.dom):
(HTMLFormatter):
(HTMLFormatter.prototype._shouldHaveNoChildren):
(HTMLFormatter.prototype._before):
(HTMLFormatter.prototype._after):
* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser.prototype.parseDocument):
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js:
(HTMLTreeBuilderFormatter.prototype._isEmptyNode):
Give the HTMLFormatter and related classes an XML mode that
has less of the smarts of XML.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: HTML Formatting: Handle infinite loop for incomplete script data
https://bugs.webkit.org/show_bug.cgi?id=201769
Reviewed by Devin Rousso.
* UserInterface/Workers/Formatter/HTMLParser.js:
(HTMLParser):
Handle EOF in the script data's loop.
Better handle EOF at the end of text data.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Improve auto completion typing performance by avoiding global forced layouts
https://bugs.webkit.org/show_bug.cgi?id=201735
Reviewed by Devin Rousso.
* UserInterface/Views/Main.css:
(#layout-measurement-container):
* UserInterface/Base/Main.js:
(WI.measureElement):
Provide a helper for measuring an element in a hidden container
that helps avoid more global layout.
* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.show):
Use measure element to avoid a global forced layout.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Tighter autocomplete bubbles
https://bugs.webkit.org/show_bug.cgi?id=201742
Reviewed by Timothy Hatcher.
* UserInterface/Views/CompletionSuggestionsView.js:
(WI.CompletionSuggestionsView.prototype.show):
Eliminate the trailing space. Use bounding client rect to get
fractional widths and raise the value so we are at an even number.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
REGRESSION: Web Inspector: Layout Timeline View does not show popover for initiator data
https://bugs.webkit.org/show_bug.cgi?id=201732
<rdar://problem/55312339>
Reviewed by Devin Rousso.
* UserInterface/Views/LayoutTimelineDataGrid.js:
(WI.LayoutTimelineDataGrid.prototype.callFramePopoverAnchorElement):
(WI.LayoutTimelineDataGrid.prototype.shouldShowCallFramePopover):
The column name was incorrect.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Uncaught Exception: null is not an object (evaluating 'Object.keys(propertyNames)​')​ (at JavaScriptRuntimeCompletionProvider.js:​244:​57)​
https://bugs.webkit.org/show_bug.cgi?id=201729
Reviewed by Devin Rousso.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded):
Don't clear the completion object group until all ongoing requests have completed.
Percision for the lifetime of the object group objects is not important, but we
surely don't want to delete an object too soon.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Formatter: Pretty Print HTML resources (including inline <script>/<style>)
https://bugs.webkit.org/show_bug.cgi?id=201535
<rdar://problem/29119232>
Reviewed by Devin Rousso.
Introduce HTMLFormatter, HTMLParser, and HTMLTreeBuilderFormatter.
- HTMLParser tokenizes HTML content and passes it to a tree builder.
- HTMLTreeBuilderFormatter uses those tokens to create a formatted dom tree of fake nodes.
- HTMLFormatter then builds formatted content and a FormatterSourceMap from that DOM tree.
The output of HTMLFormatter is intended to just modify whitespace. So it won't be a
100% compatible DOM, but will be useful for debugging and reading inline <style>
and <script>, which is a more common debugging scenario. It also maintains original
author attribute quotations or lack therefore, because again it tries to only
change whitespace. A separate tree builder could be used for tidying content.
This introduces a few tools for working with formatting:
- Tools/HTMLFormatter - debug the parser, tree builder, and output format
- Tools/SourceMaps - debug formatted content and source mappings
This also:
- renames "EsprimaFormatter" to "JSFormatter"
- eliminates an extra trailing newline in CSSFormatter output
* Tools/HTMLFormatter/HTMLTreeBuilderDebug.js: Added.
* Tools/HTMLFormatter/index.html: Added.
* Tools/HTMLFormatter/styles.css: Added.
Tool for debugging the HTML formatter components.
* Tools/SourceMaps/.gitignore: Added.
* Tools/SourceMaps/index.html: Added.
* Tools/SourceMaps/setup.sh: Added.
* Tools/SourceMaps/styles.css: Added.
Tool for debugging Formatter generated Source Maps.
* Tools/JSFormatter/JSFormatterDebug.js: Renamed from Source/WebInspectorUI/Tools/Formatting/EsprimaFormatterDebug.js.
* Tools/JSFormatter/codemirror-additions.css: Renamed from Source/WebInspectorUI/Tools/Formatting/codemirror-additions.css.
* Tools/JSFormatter/index.html: Renamed from Source/WebInspectorUI/Tools/Formatting/index.html.
Renamed this tool. EsprimaFormatter => JSFormatter.
* UserInterface/Controllers/FormatterSourceMap.js:
(WI.FormatterSourceMap.prototype.originalPositionToFormattedPosition):
(WI.FormatterSourceMap.prototype.formattedPositionToOriginalPosition):
New APIs used by tools and tests for translating "position" offsets and not line/columns.
* UserInterface/Workers/Formatter/JSFormatter.js: Renamed from Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js.
(JSFormatter):
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter):
Allow using a supplied builder, which is useful when formatting
inline content from HTMLFormatter (<style> / <script>).
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.get indentString):
(FormatterContentBuilder.prototype.get originalContent):
(FormatterContentBuilder.prototype.get indentLevel):
(FormatterContentBuilder.prototype.get originalOffset):
(FormatterContentBuilder.prototype.set originalOffset):
(FormatterContentBuilder.prototype.appendNonToken):
(FormatterContentBuilder.prototype.appendToken):
(FormatterContentBuilder.prototype.appendTokenWithPossibleNewlines):
(FormatterContentBuilder.prototype.appendMapping):
(FormatterContentBuilder.prototype.indentToLevel):
(FormatterContentBuilder.prototype.finish):
Provide API for getting / setting the original offset and indent level.
This is useful when the HTMLFormatter runs the CSSFormatter/JSFormatter
in a nested context (<style> / <script>). Add a few more APIs for
conveniences when appending tokens or important positions.
* UserInterface/Workers/Formatter/HTMLParser.js: Added.
(HTMLParser.prototype.parseDocument):
(HTMLParser.prototype._isEOF):
(HTMLParser.prototype._peek):
(HTMLParser.prototype._peekCharacterRegex):
(HTMLParser.prototype._peekString):
(HTMLParser.prototype._peekCaseInsensitiveString):
(HTMLParser.prototype._consumeWhitespace):
(HTMLParser.prototype._consumeUntilString):
(HTMLParser.prototype._consumeUntilRegex):
(HTMLParser.prototype._consumeDoubleQuotedString):
(HTMLParser):
Tokenize HTML content into nodes.
* UserInterface/Workers/Formatter/HTMLTreeBuilderFormatter.js: Added.
(HTMLTreeBuilderFormatter.prototype.get dom):
(HTMLTreeBuilderFormatter.prototype.begin):
(HTMLTreeBuilderFormatter.prototype.pushParserNode):
(HTMLTreeBuilderFormatter.prototype.end):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeTopLevel):
(HTMLTreeBuilderFormatter.prototype._pushParserNodeStack):
(HTMLTreeBuilderFormatter.prototype._isEmptyNode):
(HTMLTreeBuilderFormatter.prototype._buildDOMNodeFromOpenTag):
(HTMLTreeBuilderFormatter.prototype._buildErrorNodeFromCloseTag):
(HTMLTreeBuilderFormatter.prototype._buildSimpleNodeFromParserNode):
(HTMLTreeBuilderFormatter):
Build a simple DOM tree from parser nodes.
* UserInterface/Workers/Formatter/HTMLFormatter.js: Added.
(HTMLFormatter.let.dom):
(HTMLFormatter):
(HTMLFormatter.prototype.get success):
(HTMLFormatter.prototype.get formattedText):
(HTMLFormatter.prototype.get sourceMapData):
(HTMLFormatter.prototype._walk):
(HTMLFormatter.prototype._walkChildren):
(HTMLFormatter.prototype._isNodeSelfClosing):
(HTMLFormatter.prototype._shouldHaveInlineContent):
(HTMLFormatter.prototype._hasMultipleNewLines):
(HTMLFormatter.prototype._buildAttributeString):
(HTMLFormatter.prototype._before):
(HTMLFormatter.prototype._after):
(HTMLFormatter.prototype._formatWithNestedFormatter):
(HTMLFormatter.prototype._formatScript):
(HTMLFormatter.prototype._formatStyle):
Output pretty printed text from a HTMLTreeBuilderFormatter dom tree.
* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatHTML):
* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatJavaScript):
(FormatterWorker.prototype.formatCSS):
(FormatterWorker.prototype.formatHTML):
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.hasFormatter):
(WI.TextEditor.prototype._canUseFormatterWorker):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
Allow pretty printing HTML resources.
* UserInterface/Main.html:
* UserInterface/Test.html:
New resources.
2019-09-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: [Overrides] Command-Z doesn't undo changes after page reload
https://bugs.webkit.org/show_bug.cgi?id=201698
<rdar://problem/55276645>
Reviewed by Devin Rousso.
* UserInterface/Views/ContentViewContainer.js:
(WI.ContentViewContainer.prototype.closeAllContentViews):
Provide a filter to opt out of closing some content views.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._closeContentViewsFilter):
(WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
Avoid closing ContentViews for local resource overrides. This keeps the
SourceCodeTextEditor around and thus its undo/redo stack.
2019-09-12 Joseph Pecoraro <pecoraro@apple.com>
Uncaught Exception: TypeError: null is not an object (evaluating 'selectedTreeElement.representedObject')
https://bugs.webkit.org/show_bug.cgi?id=201716
<rdar://problem/55292615>
Reviewed by Devin Rousso.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
If a breakpoint was removed without a selection in the breakpoint tree outline
then there may be no selected tree element.
2019-09-11 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: REGRESSION: Inspector Timeline always starts at about 500ms mark on a reload
https://bugs.webkit.org/show_bug.cgi?id=200637
<rdar://problem/54218967>
Reviewed by Devin Rousso.
The Timeline was getting a startTime value from before the user started
the timeline recording because of artificial adjustments that were made
to CPUTimelineRecords. Ignore adjusted values when updating the Timeline's
start and end times.
* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype._updateTimesIfNeeded):
Use unadjusted times, which should fall in the user started / stopped
timeline range.
* UserInterface/Models/TimelineRecord.js:
(WI.TimelineRecord.prototype.get unadjustedStartTime):
(WI.TimelineRecord.prototype.get unadjustedEndTime):
Default implementation uses startTime/endTime.
* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord.prototype.get unadjustedStartTime):
* UserInterface/Models/MemoryTimelineRecord.js:
(WI.MemoryTimelineRecord.prototype.get unadjustedStartTime):
Each of these adjusted their startTime.
2019-09-11 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: REGRESSION: CPU: Overlay Markers for Thread views are off by 500ms
https://bugs.webkit.org/show_bug.cgi?id=201709
<rdar://problem/55289279>
Reviewed by Devin Rousso.
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.layout):
Use the CPUTimelineRecord's timestamp (same as the record's endTime) as the
point when the CPU sample is taken. This aligns with the rest of the UI that
assumes that the 500ms before the sample point leads up to the sample value.
2019-09-11 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Do not show override actions unless Sources tab is enabled
https://bugs.webkit.org/show_bug.cgi?id=201708
Reviewed by Devin Rousso.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.supportsLocalResourceOverrides):
2019-09-11 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: checkerboard has too much contrast in dark mode
https://bugs.webkit.org/show_bug.cgi?id=201670
Reviewed by Timothy Hatcher.
* UserInterface/Views/CanvasTabContentView.css:
(.content-view.canvas > .preview > img, .content-view.canvas .preview-container > canvas): Deleted.
Don't force a `background-color: white;` in dark mode.
2019-09-11 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Elements: don't show Changes panel when selecting text node
https://bugs.webkit.org/show_bug.cgi?id=201669
Reviewed by Joseph Pecoraro.
Show Changes panel only for elements regardless of "Show only for selected node" setting.
* UserInterface/Views/ChangesDetailsSidebarPanel.js:
(WI.ChangesDetailsSidebarPanel.prototype.supportsDOMNode):
(WI.ChangesDetailsSidebarPanel.prototype.inspect): Deleted.
2019-09-11 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
https://bugs.webkit.org/show_bug.cgi?id=201650
Reviewed by Joseph Pecoraro.
Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
required (e.g. compute pipeline). We should treat the `GPUCanvasContext` almost like a
`-webkit-canvas` client of a `WebGPUDevice`.
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.clientNodesChanged): Added.
(WI.CanvasObserver.prototype.cssCanvasClientNodesChanged):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.clientNodesChanged): Added.
(WI.CanvasManager.prototype.cssCanvasClientNodesChanged): Deleted.
* UserInterface/Models/Canvas.js:
(WI.Canvas.resetUniqueDisplayNameNumbers):
(WI.Canvas.prototype.get displayName):
(WI.Canvas.prototype.requestNode):
(WI.Canvas.prototype.requestClientNodes): Added.
(WI.Canvas.prototype.requestSize):
(WI.Canvas.prototype.clientNodesChanged): Added.
(WI.Canvas.prototype.requestCSSCanvasClientNodes): Deleted.
(WI.Canvas.prototype.cssCanvasClientNodesChanged): Deleted.
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.resolveCanvasContext):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.attached):
(WI.CanvasContentView.prototype._refreshPixelSize):
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.set canvas):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):
(WI.CanvasDetailsSidebarPanel.prototype._refreshSourceSection):
(WI.CanvasDetailsSidebarPanel.prototype._refreshClientsSection): Added.
(WI.CanvasDetailsSidebarPanel.prototype._refreshCSSCanvasSection): Deleted.
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._contentViewMouseEnter):
* UserInterface/Views/CanvasTreeElement.js:
(WI.CanvasTreeElement.prototype._handleMouseOver):
* Localizations/en.lproj/localizedStrings.js:
2019-09-11 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r249753.
caused inspector/canvas/shaderProgram-add-remove-webgl.html to
crash on all Mac platforms.
Reverted changeset:
"Web Inspector: Canvas: instrument WebGPUDevice instead of
GPUCanvasContext"
https://bugs.webkit.org/show_bug.cgi?id=201650
https://trac.webkit.org/changeset/249753
2019-09-10 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
https://bugs.webkit.org/show_bug.cgi?id=201650
Reviewed by Joseph Pecoraro.
Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
required (e.g. compute pipeline). We should treat the `GPUCanvasContext` almost like a
`-webkit-canvas` client of a `WebGPUDevice`.
* UserInterface/Protocol/CanvasObserver.js:
(WI.CanvasObserver.prototype.clientNodesChanged): Added.
(WI.CanvasObserver.prototype.cssCanvasClientNodesChanged):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.clientNodesChanged): Added.
(WI.CanvasManager.prototype.cssCanvasClientNodesChanged): Deleted.
* UserInterface/Models/Canvas.js:
(WI.Canvas.resetUniqueDisplayNameNumbers):
(WI.Canvas.prototype.get displayName):
(WI.Canvas.prototype.requestNode):
(WI.Canvas.prototype.requestClientNodes): Added.
(WI.Canvas.prototype.requestSize):
(WI.Canvas.prototype.clientNodesChanged): Added.
(WI.Canvas.prototype.requestCSSCanvasClientNodes): Deleted.
(WI.Canvas.prototype.cssCanvasClientNodesChanged): Deleted.
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.resolveCanvasContext):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.attached):
(WI.CanvasContentView.prototype._refreshPixelSize):
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.set canvas):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):
(WI.CanvasDetailsSidebarPanel.prototype._refreshSourceSection):
(WI.CanvasDetailsSidebarPanel.prototype._refreshClientsSection): Added.
(WI.CanvasDetailsSidebarPanel.prototype._refreshCSSCanvasSection): Deleted.
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._contentViewMouseEnter):
* UserInterface/Views/CanvasTreeElement.js:
(WI.CanvasTreeElement.prototype._handleMouseOver):
* Localizations/en.lproj/localizedStrings.js:
2019-09-10 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove legacy CodeMirror based pretty printers
https://bugs.webkit.org/show_bug.cgi?id=201624
Reviewed by Devin Rousso.
* Tools/PrettyPrinting/FormatterDebug.js: Removed.
* Tools/PrettyPrinting/Utilities.js: Removed.
* Tools/PrettyPrinting/codemirror-additions.css: Removed.
* Tools/PrettyPrinting/index.html: Removed.
* Tools/PrettyPrinting/populate/apple.css: Removed.
* UserInterface/Controllers/Formatter.js: Removed.
* UserInterface/Main.html:
* UserInterface/Test.html:
* UserInterface/Views/CodeMirrorFormatters.js: Removed.
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.prettyPrint):
(WI.TextEditor.prototype._canUseFormatterWorker): Deleted.
(WI.TextEditor.prototype._startCodeMirrorPrettyPrint): Deleted.
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
2019-09-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Dark Mode: Overview Timeline View has jarring white box-shadows in dark mode
https://bugs.webkit.org/show_bug.cgi?id=201442
<rdar://problem/54999794>
Reviewed by Devin Rousso.
* UserInterface/Views/DataGrid.css:
(.data-grid:not(.variable-height-rows) table.data):
(.data-grid:not(.variable-height-rows) table.data.even-first-zebra-stripe):
(.data-grid.variable-height-rows.even-first-zebra-stripe table.data tr:nth-child(odd)):
(.data-grid.variable-height-rows.even-first-zebra-stripe table.data tr:nth-child(even)):
(.data-grid:not(.variable-height-rows) table.data.odd-first-zebra-stripe): Deleted.
(.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(odd)): Deleted.
(.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(even)): Deleted.
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype.updateVisibleRows):
* UserInterface/Views/Table.css:
(.table > .data-container > .data-list):
(.table > .data-container > .data-list.even-first-zebra-stripe):
(.table > .data-container > .data-list.odd-first-zebra-stripe): Deleted.
* UserInterface/Views/Table.js:
In the gradients "even" was mistakenly first. Fix these so that "odd" is first and the
unusual case would be having "even" first. This allows us to line up with `nth-of-type(even)`.
* UserInterface/Views/Main.css:
(:root):
(@media (prefers-color-scheme: dark)):
Flip even and odd so we maintain the same styles for gradients.
* UserInterface/Views/OverviewTimelineView.css:
(.timeline-view.overview > .data-grid tr):
(.timeline-view.overview > .data-grid tr:nth-child(even)):
(.timeline-view.overview > .data-grid tr.parent:not(.expanded) td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment):
(.timeline-view.overview > .data-grid tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar:not(.has-inactive-segment) > .segment):
(.timeline-view.overview > .data-grid tr.parent:not(.expanded) td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(.timeline-view.overview > .data-grid tr.parent:not(.expanded).selected td.graph-column .timeline-record-bar.has-inactive-segment > .segment:not(.inactive)):
(@media (prefers-color-scheme: dark)):
(WI.Table.prototype._updateVisibleRows):
* UserInterface/Views/Variables.css:
2019-09-06 Devin Rousso <drousso@apple.com>
Web Inspector: CSS Formatter: the closing } of nested @media aren't indented
https://bugs.webkit.org/show_bug.cgi?id=201560
Reviewed by Joseph Pecoraro.
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.removeLastNewline):
It's possible that there were multiple newlines in a row, so we should update `_startOfLine`
to be `true` if the previous line was empty.
2019-09-06 Devin Rousso <drousso@apple.com>
Web Inspector: CSS Formatter: links to CSS resources don't map to the right line after pretty printing if the line is after a multiline comment
https://bugs.webkit.org/show_bug.cgi?id=201559
Reviewed by Joseph Pecoraro.
Newlines in multiline comments weren't added as line endings, so they weren't considered
when a source code location updated after pretty printing.
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter.prototype._format):
2019-09-06 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Better position for Sources tab when enabling the experimental setting
https://bugs.webkit.org/show_bug.cgi?id=201539
Reviewed by Devin Rousso.
* UserInterface/Views/SettingsTabContentView.js:
Place the Sources tab where the Debugger tab was.
2019-09-06 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Network: Error response headers summary has wrong color border
https://bugs.webkit.org/show_bug.cgi?id=201538
<rdar://problem/55104469>
Reviewed by Devin Rousso.
* UserInterface/Views/ResourceHeadersContentView.css:
(body[dir] .resource-headers > section.error > .details):
Re-apply an error style for resource-header sections.
2019-09-04 Devin Rousso <drousso@apple.com>
Web Inspector: unify the interaction of show/hide status icons in Sources and Canvas
https://bugs.webkit.org/show_bug.cgi?id=201470
Reviewed by Joseph Pecoraro.
Rather than "fading" the tree element's text when the underlying represented object is
disabled/blackboxed, we should just "fade" the icon. The "fade" shouldn't change when the
tree element is selected. The image of the status eye also shouldn't change depending on
whether the underlying represented object is disabled/blackboxed, as it being visible (even
if it's "faded") is already enough of an indicator.
It should also be possible to toggle the disabled/blackboxed state via the context menu.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
* UserInterface/Views/SourceCodeTreeElement.css:
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed, .tree-outline .item:not(:hover) .status > .toggle-script-blackboxed:not(.blackboxed)): Added.
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed, .tree-outline .item:not(:hover, .selected) .status > .toggle-script-blackboxed:not(.blackboxed)): Deleted.
* UserInterface/Models/ShaderProgram.js:
(WI.ShaderProgram):
(WI.ShaderProgram.prototype.get disabled): Added.
(WI.ShaderProgram.prototype.set disabled): Added.
(WI.ShaderProgram.prototype.toggleDisabled): Deleted.
* UserInterface/Views/ShaderProgramTreeElement.js:
(WI.ShaderProgramTreeElement.prototype.onattach):
(WI.ShaderProgramTreeElement.prototype.ondetach): Added.
(WI.ShaderProgramTreeElement.prototype.canSelectOnMouseDown):
(WI.ShaderProgramTreeElement.prototype.populateContextMenu): Added.
(WI.ShaderProgramTreeElement.prototype._disabledImageElementClicked):
(WI.ShaderProgramTreeElement.prototype._handleShaderProgramDisabledChanged): Added.
* UserInterface/Views/ShaderProgramTreeElement.css:
(.tree-outline .item.shader-program .status > img): Added.
(.tree-outline .item.shader-program:not(:hover, .selected, .disabled) .status > img): Added.
(.tree-outline .item.shader-program.disabled .status > img): Added.
(@media (prefers-color-scheme: dark) .tree-outline .item.shader-program .status > img): Added.
(.item.shader-program .status > img): Deleted.
(.item.shader-program.disabled:hover .status > img): Deleted.
(.item.shader-program:not(:hover, .selected, .disabled) .status > img): Deleted.
(.item.shader-program.disabled > :not(.status)): Deleted.
(@media (prefers-color-scheme: dark) .item.shader-program .status > img): Deleted.
2019-09-04 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Local Overrides - Provide substitution content for resource loads (URL based)
https://bugs.webkit.org/show_bug.cgi?id=201262
<rdar://problem/13108764>
Reviewed by Devin Rousso.
This adds a new "Local Overrides" section to the Sources tab sidebar
which will allow users to provide their own resource content for text
resources. Users can clone a resource, and provide their own content
(by editing in Web Inspector) and new requests for those particular
URLs will get the substitute content.
Overrides are based on a particular URL (ignoring fragment). They
can override: status code, status text, response headers, content,
and MIME Type (Content-Type).
* Tools/CodeMirrorModes/index.html: Added.
* Tools/CodeMirrorModes/styles.css: Added.
Debug tool for CodeMirror editors and our custom CodeMirror modes.
* UserInterface/Main.html:
* UserInterface/Test.html:
* Localizations/en.lproj/localizedStrings.js:
New files and strings.
* UserInterface/Base/HTTPUtilities.js: Added.
(WI.httpStatusTextForStatusCode):
Translate between typical status codes and status text.
* UserInterface/Base/ObjectStore.js:
(WI.ObjectStore._open):
New persistent store for local resource overrides.
* UserInterface/Base/Main.js:
(WI.showLocalResourceOverride):
Convenience for showing an override file.
* UserInterface/Base/URLUtilities.js:
(parseURL):
Avoid uncaught exceptions with the URL constructor for common WebKit internal sourceURL strings.
(WI.urlWithoutFragment):
Strip a fragment from a URL.
* UserInterface/Controllers/HARBuilder.js:
(WI.HARBuilder.fetchType):
(WI.HARBuilder.responseSourceFromHARFetchType):
Handle new custom response types.
* UserInterface/Protocol/NetworkObserver.js:
(WI.NetworkObserver.prototype.responseIntercepted):
(WI.NetworkObserver):
New events.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.supportsLocalResourceOverrides):
(WI.NetworkManager.prototype.initializeTarget):
(WI.NetworkManager.prototype.get localResourceOverrides):
(WI.NetworkManager.prototype.get interceptionEnabled):
(WI.NetworkManager.prototype.set interceptionEnabled):
(WI.NetworkManager.prototype.addLocalResourceOverride):
(WI.NetworkManager.prototype.removeLocalResourceOverride):
(WI.NetworkManager.prototype.localResourceOverrideForURL):
(WI.NetworkManager.prototype.canBeOverridden):
(WI.NetworkManager.prototype.responseIntercepted):
(WI.NetworkManager.prototype._handleResourceContentDidChange):
(WI.NetworkManager.prototype._persistLocalResourceOverrideSoonAfterContentChange):
(WI.NetworkManager.prototype._saveLocalResourceOverrides):
(WI.NetworkManager.prototype._extraDomainsActivated):
(WI.NetworkManager.prototype.localResourceForURL): Deleted.
Handle saving and restoring local resource overrides.
Handle responding to a `responseIntercepted` Network protocol event.
* UserInterface/Models/LocalResource.js:
(WI.LocalResource.fromJSON):
(WI.LocalResource.prototype.toJSON):
(WI.LocalResource.prototype.get localContent):
(WI.LocalResource.prototype.get localContentIsBase64Encoded):
(WI.LocalResource.prototype.isLocalResourceOverride):
(WI.LocalResource.prototype.updateOverrideContent):
Allow a LocalResource to identify itself as an "override".
* UserInterface/Models/LocalResourceOverride.js: Added.
(WI.LocalResourceOverride.prototype.create):
(WI.LocalResourceOverride.fromJSON):
(WI.LocalResourceOverride.prototype.toJSON):
(WI.LocalResourceOverride.prototype.get url):
(WI.LocalResourceOverride.prototype.get localResource):
(WI.LocalResourceOverride.prototype.get disabled):
(WI.LocalResourceOverride.prototype.set disabled):
(WI.LocalResourceOverride.prototype.saveIdentityToCookie):
(WI.LocalResourceOverride):
Model object for a LocalResourceOverride. This has LocalResource content
and an enabled/disabled state.
* UserInterface/Models/Resource.js:
(WI.Resource.classNamesForResource):
(WI.Resource.responseSourceFromPayload):
(WI.Resource.prototype.isLocalResourceOverride):
(WI.Resource.prototype.async.createLocalResourceOverride):
(WI.Resource.classNameForResource): Deleted.
Convenience functions and icon updates.
* UserInterface/Views/SourcesTabContentView.js:
(WI.SourcesTabContentView.prototype.canShowRepresentedObject):
* UserInterface/Views/ContentView.js:
(WI.ContentView.createFromRepresentedObject):
(WI.ContentView.resolvedRepresentedObjectForRepresentedObject):
(WI.ContentView.isViewable):
Handle new represented object type.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline):
(WI.SourcesNavigationSidebarPanel.prototype.willDismissPopover):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissLocalOverridePopover):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissEventBreakpointPopover):
(WI.SourcesNavigationSidebarPanel.prototype._willDismissURLBreakpointPopover):
(WI.SourcesNavigationSidebarPanel.prototype._addLocalResourceOverride):
(WI.SourcesNavigationSidebarPanel.prototype._removeLocalResourceOverride):
(WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
(WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideAdded):
(WI.SourcesNavigationSidebarPanel.prototype._handleLocalResourceOverrideRemoved):
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .warning-banner):
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container, .local-overrides)):
(.sidebar > .panel.navigation.sources > .content > .local-overrides):
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Deleted.
Hide and show Local Overrides section.
* UserInterface/Views/LocalResourceOverrideTreeElement.css:
(.item.resource.override .status > div):
* UserInterface/Views/LocalResourceOverrideTreeElement.js: Added.
(WI.LocalResourceOverrideTreeElement):
(WI.LocalResourceOverrideTreeElement.prototype.canSelectOnMouseDown):
(WI.LocalResourceOverrideTreeElement.prototype.populateContextMenu):
(WI.LocalResourceOverrideTreeElement.prototype.willDismissPopover):
TreeElement for a Local Resource Override.
* UserInterface/Views/CodeMirrorLocalOverrideURLMode.css:
(.cm-s-default .cm-local-override-url-bad-scheme):
(.cm-s-default .cm-local-override-url-fragment):
* UserInterface/Views/CodeMirrorLocalOverrideURLMode.js: Added.
(tokenBase):
(return.startState):
(return.token):
* UserInterface/Views/ContentBrowserTabContentView.js:
(WI.ContentBrowserTabContentView.prototype._revealAndSelectRepresentedObject):
* UserInterface/Views/ContextMenu.js:
(WI.ContextMenu.prototype._itemSelected):
(WI.ContextMenu):
Better debugging for exceptions in context menu handlers.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForSourceCode):
(WI.appendContextMenuItemsForURL):
Context menu items for Local Resource Overrides.
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype.startEditingNode):
(WI.DataGrid.prototype._startEditingNodeAtColumnIndex):
(WI.DataGrid.prototype._startEditing):
(WI.DataGrid.prototype._contextMenuInDataTable):
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode):
(WI.DataGridNode.prototype.get editable):
(WI.DataGridNode.prototype.set editable):
Improve DataGrid editing functionality.
Allow a node to not be editable.
Allow adding a new node and starting to edit in one action.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype.treeElementForRepresentedObject):
Do not provide overrides in the Debugger tab.
* UserInterface/Views/LocalResourceOverrideLabelView.css:
(.local-resource-override-label-view):
(.local-resource-override-label-view > div):
(.local-resource-override-label-view > div > .label):
(.local-resource-override-label-view > div > .url):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/LocalResourceOverrideLabelView.js:
(WI.LocalResourceOverrideLabelView):
(WI.LocalResourceOverrideLabelView.prototype.initialLayout):
* UserInterface/Views/LocalResourceOverridePopover.css: Added.
(.popover .local-resource-override-popover-content):
(.popover .local-resource-override-popover-content > label.toggle):
(.popover .local-resource-override-popover-content > table):
(.popover .local-resource-override-popover-content > table > tr > th):
(.popover .local-resource-override-popover-content > table > tr > td):
(.popover .local-resource-override-popover-content .editor):
(.popover .local-resource-override-popover-content .editor > .CodeMirror):
(.popover .local-resource-override-popover-content .editor.url):
(.popover .local-resource-override-popover-content .editor.mime):
(.popover .local-resource-override-popover-content .editor.status):
(.popover .local-resource-override-popover-content .editor.status-text):
(.popover .local-resource-override-popover-content .add-header):
(@media (prefers-color-scheme: dark)):
New banner view for a local resource override itself.
Shows the URL being overriden.
* UserInterface/Views/LocalResourceOverrideWarningView.css:
(.local-resource-override-warning-view):
(.local-resource-override-warning-view[hidden]):
(.local-resource-override-warning-view > div):
(.local-resource-override-warning-view > div > button):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/LocalResourceOverrideWarningView.js: Added.
(WI.LocalResourceOverrideWarningView):
(WI.LocalResourceOverrideWarningView.prototype.attached):
(WI.LocalResourceOverrideWarningView.prototype.detached):
(WI.LocalResourceOverrideWarningView.prototype._updateContent):
(WI.LocalResourceOverrideWarningView.prototype._handleLocalResourceOverrideChanged):
* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel.prototype.pruneStaleResourceTreeElements):
New banner view for a resource that has been overridden.
Allows jumping to the override itself.
* UserInterface/Views/LocalResourceOverridePopover.js: Added.
(WI.LocalResourceOverridePopover):
(WI.LocalResourceOverridePopover.prototype.get serializedData):
(WI.LocalResourceOverridePopover.prototype.show.addDataGridNodeForHeader):
(WI.LocalResourceOverridePopover.prototype.show):
(WI.LocalResourceOverridePopover.prototype._createEditor):
(WI.LocalResourceOverridePopover.prototype._defaultURL):
(WI.LocalResourceOverridePopover.prototype._presentOverTargetElement):
New popover for creating or editing a Local Resource Override.
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.performSearch):
Consider searching overrides.
* UserInterface/Views/Variables.css:
(:root):
* UserInterface/Views/SearchSidebarPanel.css:
(.sidebar > .panel.navigation.search.changed > .banner):
* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .warning-banner):
* UserInterface/Views/ConsoleMessageView.css:
(.console-warning-level):
Use a new variable for a common warning color.
* UserInterface/Images/NavigationItemNetworkOverride.svg: Added.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.canBeFormatted):
(WI.SourceCodeTextEditor.prototype.get _supportsDebugging):
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .warning-banner):
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container, .local-overrides)):
(.sidebar > .panel.navigation.sources > .content > .local-overrides):
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Deleted.
* UserInterface/Views/TextEditor.css:
(.text-editor):
* UserInterface/Views/TextResourceContentView.css:
(.content-view.resource.text):
(.content-view.resource.text > .text-editor):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView):
(WI.TextResourceContentView.prototype.get navigationItems):
(WI.TextResourceContentView.prototype.closed):
(WI.TextResourceContentView.prototype._contentWillPopulate):
(WI.TextResourceContentView.prototype._contentDidPopulate):
(WI.TextResourceContentView.prototype.async._handleCreateLocalResourceOverride):
(WI.TextResourceContentView.prototype._handleRemoveLocalResourceOverride):
(WI.TextResourceContentView.prototype._handleLocalResourceOverrideChanged):
(WI.TextResourceContentView.prototype._textEditorContentDidChange):
(WI.TextResourceContentView.prototype._shouldBeEditable):
Allow Text resources to create a local resource override.
Support for Image resources will come separately.
* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._responseSourceDisplayString):
Handle new response type.
* UserInterface/Controllers/CSSManager.js:
Avoid extra handling for Local Resource Overrides.
* UserInterface/Views/ResourceIcons.css:
(.resource-icon.override .icon):
* UserInterface/Views/ResourceSizesContentView.js:
(WI.ResourceSizesContentView.prototype.initialLayout):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WI.ResourceTimelineDataGridNode.prototype.iconClassNames):
* UserInterface/Views/ResourceTreeElement.js:
(WI.ResourceTreeElement.prototype._updateResource):
(WI.ResourceTreeElement.prototype._updateIcon):
(WI.ResourceTreeElement.prototype._responseReceived):
(WI.ResourceTreeElement):
* UserInterface/Views/TimelineDataGridNode.js:
(WI.TimelineDataGridNode.prototype.createCellContent):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._populateNameCell):
(WI.NetworkTableContentView.prototype._populateTransferSizeCell):
(WI.NetworkTableContentView.prototype._generateSortComparator):
Better Resource icons all over for overrides.
* UserInterface/Views/URLBreakpointPopover.js:
(WI.URLBreakpointPopover.prototype._createEditor):
Code cleanup.
2019-09-03 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to view XML/HTML/SVG resource responses as a DOM tree
https://bugs.webkit.org/show_bug.cgi?id=201046
<rdar://problem/54446087>
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView):
(WI.ResourceClusterContentView.prototype.showRequest):
(WI.ResourceClusterContentView.prototype.showResponse):
(WI.ResourceClusterContentView.prototype.get customRequestDOMContentView): Added.
(WI.ResourceClusterContentView.prototype.get customRequestJSONContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseDOMContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseJSONContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseTextContentView): Added.
(WI.ResourceClusterContentView.prototype._createPathComponent): Added.
(WI.ResourceClusterContentView.prototype._canShowCustomRequestContentView):
(WI.ResourceClusterContentView.prototype._canShowCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._contentViewForResourceType):
(WI.ResourceClusterContentView.prototype._pathComponentForContentView):
(WI.ResourceClusterContentView.prototype._identifierForContentView):
(WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
(WI.ResourceClusterContentView.prototype._resourceLoadingDidFinish):
(WI.ResourceClusterContentView.prototype._canUseDOMContentViewForContent): Added.
(WI.ResourceClusterContentView.prototype._normalizeMIMETypeForDOM): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentViews): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentViews): Added.
(WI.ResourceClusterContentView.createPathComponent): Deleted.
(WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentView): Deleted.
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView): Deleted.
* UserInterface/Base/Main.js:
(WI.showResourceRequest):
* UserInterface/Views/PathComponentIcons.css:
(.object-icon .icon): Added.
* UserInterface/Main.html:
* UserInterface/Views/SVGImageResourceClusterContentView.js: Removed.
Reworked to allow more than one custom request/response content view at the same time. As
such, merge the `WI.SVGImageResourceClusterContentView` into this class.
* UserInterface/Views/LocalRemoteObjectContentView.js: Added.
(WI.LocalRemoteObjectContentView):
(WI.LocalRemoteObjectContentView.prototype.get expression):
(WI.LocalRemoteObjectContentView.prototype.renderRemoteObject):
(WI.LocalRemoteObjectContentView.prototype.initialLayout):
(WI.LocalRemoteObjectContentView.prototype.attached):
(WI.LocalRemoteObjectContentView.prototype.closed):
* UserInterface/Views/LocalRemoteObjectContentView.css: Added.
(.content-view.local-remote-object):
* UserInterface/Views/LocalDOMContentView.js: Added.
(WI.LocalDOMContentView):
(WI.LocalDOMContentView.prototype.get expression):
(WI.LocalDOMContentView.prototype.renderRemoteObject):
* UserInterface/Views/LocalJSONContentView.js: Added.
(WI.LocalJSONContentView):
(WI.LocalJSONContentView.prototype.get expression):
(WI.LocalJSONContentView.prototype.renderRemoteObject):
* UserInterface/Views/JSONContentView.js: Removed.
* UserInterface/Views/JSONContentView.css: Removed.
Rework `WI.JSONContentView` into a more generic set of classes that render an object we send
to the inspected page for instrumentation.
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
(WI.DOMTreeOutline.prototype._onmousemove):
(WI.DOMTreeOutline.prototype._onmouseout):
(WI.DOMTreeOutline.prototype._ondragstart):
(WI.DOMTreeOutline.prototype._ondragover):
(WI.DOMTreeOutline.prototype._ondragleave):
(WI.DOMTreeOutline.prototype._ondragend):
(WI.DOMTreeOutline.prototype._hideElements):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
Ensure that interactions that would modify the DOM tree only happen when editable. If the
`WI.DOMTreeOutline` represents a "local" `WI.DOMNode` (one that's been sent to the inspected
page for instrumentation, and shouldn't be part of the main #document), don't allow any
editing actions to be performed.
* UserInterface/Views/TextContentView.js:
(WI.TextContentView):
Allow a `representedObject` object to be provided and used instead of the given `string`.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Images/Object.svg: Added.
2019-09-03 Devin Rousso <drousso@apple.com>
Web Inspector: implement blackboxing of script resources
https://bugs.webkit.org/show_bug.cgi?id=17240
<rdar://problem/5732847>
Reviewed by Joseph Pecoraro.
When a script is blackboxed and the debugger attempts to pause in that script, the pause
reason/data will be saved and execution will continue until it has left the blackboxed
script. Once outside, execution is paused with the saved reason/data.
This is especially useful when debugging issues using libraries/frameworks, as it allows the
developer to "skip" the internal logic of the library/framework and instead focus only on
how they're using it.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.supportsBlackboxingScripts): Added.
(WI.DebuggerManager.pauseReasonFromPayload): Added.
(WI.DebuggerManager.prototype.isScriptBlackboxed): Added.
(WI.DebuggerManager.prototype.setShouldBlackboxScript): Added.
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
(WI.DebuggerManager.prototype._pauseReasonFromPayload): Deleted.
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype.get isScript): Added.
(WI.SourceCode.prototype.get supportsScriptBlackboxing): Added.
* UserInterface/Models/Script.js:
(WI.Script.prototype.get isScript): Added.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get isScript): Added.
Provide a more straightforward way of determining if a `WI.SourceCode` is a script.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._updatePauseReason):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReason):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
Display the original pause reason and breakpoint (if applicable) when pausing after leaving
a blackboxed script.
* UserInterface/Views/SourceCodeTreeElement.js:
(WI.SourceCodeTreeElement.prototype.canSelectOnMouseDown): Added.
(WI.SourceCodeTreeElement.prototype.updateStatus): Added.
(WI.SourceCodeTreeElement.prototype._updateSourceCode):
(WI.SourceCodeTreeElement.prototype._updateToggleBlackboxImageElementState): Added.
(WI.SourceCodeTreeElement.prototype._handleToggleBlackboxedImageElementClick): Added.
* UserInterface/Views/SourceCodeTreeElement.css: Added.
(.tree-outline .item .status > .toggle-script-blackboxed):
(.tree-outline:not(.navigation-sidebar-panel-content-tree-outline) .item .status > .toggle-script-blackboxed,):
(.tree-outline:focus .item.selected .status > .toggle-script-blackboxed):
(.tree-outline .item .status > .toggle-script-blackboxed.blackboxed):
(@media (prefers-color-scheme: dark) .tree-outline .item .status > .toggle-script-blackboxed):
* UserInterface/Views/ResourceTreeElement.js:
(WI.ResourceTreeElement.prototype._updateResource):
(WI.ResourceTreeElement.prototype.updateStatus): Added.
(WI.ResourceTreeElement.prototype._updateStatus): Deleted.
Make sure that the loading indicator doesn't override the blackbox toggle.
* UserInterface/Base/Setting.js:
(WI.Setting.prototype.set value):
(WI.Setting.prototype.save): Added.
When modifying an array value, that doesn't go through `WI.Setting.prototype.set value`, so
we need a more "manual" way of saving the new value.
* UserInterface/Main.html:
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.newline): Added.
(TestHarness.prototype.expectException):
Add a special case for logging error message objects when running protocol tests.
2019-08-29 Keith Rollin <krollin@apple.com>
Update .xcconfig symbols to reflect the current set of past and future product versions.
https://bugs.webkit.org/show_bug.cgi?id=200720
<rdar://problem/54305032>
Reviewed by Alex Christensen.
Remove version symbols related to old OS's we no longer support,
ensure that version symbols are defined for OS's we do support.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/Version.xcconfig:
2019-08-29 Devin Rousso <drousso@apple.com>
Web Inspector: DOMDebugger: support event breakpoints in Worker contexts
https://bugs.webkit.org/show_bug.cgi?id=200651
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
Add assertions when adding/removing DOM breakpoints or animation frame event breakpoints if
the target is a `WI.WorkerTarget`, as neither are supported by `Worker`s.
2019-08-29 Devin Rousso <drousso@apple.com>
Web Inspector: replace uses of `Array.prototype.concat` with `Array.prototype.push`
https://bugs.webkit.org/show_bug.cgi?id=201082
Reviewed by Joseph Pecoraro.
`x = x.concat(y)` is very slow, as `x` has to be fully copied in order to add `y` to it.
Introduce `Array.prototype.pushIterable`, which iterates the given `iterable` and adds each
item to the `this` array.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.get domBreakpoints):
(WI.DOMDebuggerManager.prototype.domBreakpointsInSubtree):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions):
* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.forProperty):
(WI.CSSKeywordCompletions.forProperty.addKeywordsForName):
(WI.CSSKeywordCompletions.forFunction):
* UserInterface/Models/Canvas.js:
(WI.Canvas.prototype.recordingProgress):
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._updateStyleCascade):
(WI.DOMNodeStyles.prototype._collectStylesInCascadeOrder):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.prototype.get sourceCodeTimelines):
(WI.TimelineRecording.prototype.initializeCallingContextTrees):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype._getPropertyDescriptorsResolver):
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype.get currentRepresentedObjects):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._visibleChildren):
* UserInterface/Views/DataGridNode.js:
(WI.DataGridNode.prototype.get filterableData):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WI.IndexedDatabaseObjectStoreContentView.prototype._fetchMoreData.processEntries):
* UserInterface/Views/NavigationItem.js:
(WI.NavigationItem.prototype.get _classNames):
* UserInterface/Views/ObjectTreeView.js:
(WI.ObjectTreeView.prototype._updateProperties):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addResourcesForFrame):
* UserInterface/Views/OverviewTimelineView.js:
(WI.OverviewTimelineView.prototype._loadExistingRecords):
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView.prototype.get navigationItems):
* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ResourceSecurityContentView.js:
(WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs):
* UserInterface/Views/ScriptClusterTimelineView.js:
(WI.ScriptClusterTimelineView.prototype.get selectionPathComponents):
* UserInterface/Views/ScrubberNavigationItem.js:
(WI.ScrubberNavigationItem.prototype.get additionalClassNames):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens.pushPossibleColorToken):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
(WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.selfOrDescendant):
* UserInterface/Views/View.js:
(WI.View._visitViewTreeForLayout):
2019-08-29 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION (r248873): Debugger: pressing delete on a breakpoint will also delete any resource/element parent immediately before it in the list
https://bugs.webkit.org/show_bug.cgi?id=200939
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.this._breakpointsTreeOutline.ondelete.checkIfSelectionAdjustmentNeeded): Deleted.
When the `WI.TreeOutline`'s own `ondelete` is called, that means we must be handling a
delete that was _not_ handled by a `WI.TreeElement`. This means that the `selectedTreeElement`
has to be a resource/script, the `window` object, or one of the non-deletable breakpoints.
In the case of a non-deletable breakpoint, since they're never removed from their parent
`WI.TreeOutline`, we just shift the selection to the next selectable `WI.TreeElement`.
Otherwise, wait for the `WI.TreeOutline.Event.ElementRemoved` event to be fired, and adjust
the selection then based on whether the new `selectedTreeElement` is one of the "top" items,
namely the "All Exceptions", "Uncaught Exceptions", and "Assertion Failures" breakpoints.
* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.ondelete):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement.prototype.ondelete):
Add `return true;` to let the parent `WI.TreeOutline` know that the delete event was handled.
This prevents the parent `WI.TreeOutline`'s own `ondelete` from being called, which would
cause a double-delete as there would be a different `selectedTreeElement`.
2019-08-29 Keith Rollin <krollin@apple.com>
Remove support for macOS < 10.13 (part 3)
https://bugs.webkit.org/show_bug.cgi?id=201224
<rdar://problem/54795934>
Reviewed by Darin Adler.
Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
like _MACOS_SINCE_1013.
Also added some macOS target numbers.
* Configurations/WebKitTargetConditionals.xcconfig:
2019-08-29 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Import file pickers sometimes do not import
https://bugs.webkit.org/show_bug.cgi?id=201290
<rdar://problem/54826117>
Reviewed by Devin Rousso.
* UserInterface/Base/FileUtilities.js:
(WI.FileUtilities.importText):
(WI.FileUtilities.importJSON):
Keep the input element alive so it doesn't get garbage collected,
which makes the file chooser do nothing.
(WI.FileUtilities.save):
(WI.FileUtilities.async.readText):
Place read operations after event handlers are setup in case the
read operations can happen synchronously and events may not fire.
2019-08-28 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r249078): JavaScript autocomplete doesn't work when evaluating properties of values
https://bugs.webkit.org/show_bug.cgi?id=201226
Reviewed by Joseph Pecoraro.
r249078 modified `WI.JavaScriptRuntimeCompletionProvider` to use arrays of property names
instead of objects for completion, but a few code paths were missed.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNamesFromEvaluate):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedObjectPropertyNames): Added.
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedArrayPropertyNames):
* UserInterface/Models/CallFrame.js:
(WI.CallFrame.prototype.collectScopeChainVariableNames):
(WI.CallFrame.prototype.collectScopeChainVariableNames.propertiesCollected):
2019-08-27 Devin Rousso <drousso@apple.com>
Web Inspector: replace uses of added utility `Array.prototype.keySet` with an actual `Set`
https://bugs.webkit.org/show_bug.cgi?id=201194
Reviewed by Ross Kirsling.
They both have basically the same functionality, with one difference being that a `Set` can
work with arrays that have non-string values.
* UserInterface/Base/Utilities.js:
(Array.prototype.keySet): Deleted.
* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WI.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
(WI.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions.matchKeywords):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
2019-08-27 Devin Rousso <drousso@apple.com>
Web Inspector: change the styling of the special log "bubble" to match WI.ScopeBar
https://bugs.webkit.org/show_bug.cgi?id=201152
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ConsoleMessageView.css:
(.console-user-command.special-user-log > .console-message-body):
2019-08-26 Devin Rousso <drousso@apple.com>
Web Inspector: decrease horizontal padding of `WI.ScopeBar` to have more room
https://bugs.webkit.org/show_bug.cgi?id=201090
Reviewed by Joseph Pecoraro.
There's a lot of "wasted" padding space around each item that we could reuse (or "move") for
other navigation items.
* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item.scope-bar):
* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button.text-only):
* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
(.scope-bar > li.multiple > .arrows):
* UserInterface/Views/RadioButtonNavigationItem.js:
(WI.RadioButtonNavigationItem):
(WI.RadioButtonNavigationItem.prototype.update): Deleted.
There's no reason to forcibly set the `min-width` since all instances are just text.
* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.initialLayout):
* UserInterface/Views/AuditTestGroupContentView.css:
(.content-view.audit-test-group > header > nav:not(:empty):before): Deleted.
Remove the unnecessary "Showing: " prefix before the `WI.ScopeBar`.
* UserInterface/Views/ScopeRadioButtonNavigationItem.js: Removed.
* UserInterface/Views/ScopeRadioButtonNavigationItem.css: Removed.
These classes were never used.
* Localizations/en.lproj/localizedStrings.js:
2019-08-24 Devin Rousso <drousso@apple.com>
Web Inspector: "Copy Rule" menu item does not propagate comments properly
https://bugs.webkit.org/show_bug.cgi?id=201095
Reviewed by Joseph Pecoraro.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.commentOut):
(WI.CSSProperty.prototype.get formattedText):
Wrap the `text` in `/* ${text} */` if the `WI.CSSProperty` isn't `enabled` (e.g. commented out).
2019-08-23 Devin Rousso <drousso@apple.com>
Web Inspector: create additional command line api functions for other console methods
https://bugs.webkit.org/show_bug.cgi?id=200971
Reviewed by Joseph Pecoraro.
Expose all `console.*` functions in the command line API, since they're all already able to
be referenced via the `console` object.
Provide a simpler interface for other injected scripts to modify the command line API.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.prototype.get _commandLineAPIKeys): Added.
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.updateLastPropertyNames):
(WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.receivedPropertyNames):
2019-08-23 Devin Rousso <drousso@apple.com>
Web Inspector: transparency checkerboard is too bright in dark mode
https://bugs.webkit.org/show_bug.cgi?id=201067
Reviewed by Joseph Pecoraro.
* UserInterface/Views/Main.css:
(@media (prefers-color-scheme: dark) :matches(img, canvas).show-grid):
* UserInterface/Views/ConsoleMessageView.css:
(.console-message-body > .show-grid):
2019-08-22 Devin Rousso <drousso@apple.com>
Web Inspector: Console: automatically select the "Evaluations" filter whenever running commands
https://bugs.webkit.org/show_bug.cgi?id=201060
Reviewed by Timothy Hatcher.
If the Console is actively being filtered (e.g. not "All"), it can be confusing to run a
command, only to not see any results. We should automatically enable the "Evaluations"
filter in addition to any other existing filters in these cases.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.didAppendConsoleMessageView):
* UserInterface/Views/ScopeBarItem.js:
(WI.ScopeBarItem.prototype.set selected):
(WI.ScopeBarItem.prototype.toggle): Added.
2019-08-22 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248485): stack overflow when viewing a source map generated from inline content
https://bugs.webkit.org/show_bug.cgi?id=201042
<rdar://problem/54509750>
Reviewed by Antoine Quint.
In r248485, `WI.ResourceClusterContentView` was changed to `requestContent` whenever the
given resource finished loading (by listening for `WI.Resource.Event.LoadingDidFinish`).
Even though retrieving a source map's contents uses `Promise`s, in the case that the content
was inlined in the "original" source code, the code path would mark the source map as being
finished (which would fire a `WI.Resource.Event.LoadingDidFinish`) _before_ it could return
a `Promise`, which would've been cached (`WI.SourceCode.prototype.requestContent`) and
preventend any reentrancy.
Wrapping the inline code path in a `Promise.resolve()` gives the `WI.SourceCode` a chance to
cache the `Promise` before any events are fired.
* UserInterface/Models/SourceMapResource.js:
(WI.SourceMapResource.prototype.requestContentFromBackend):
2019-08-22 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: console.dir should expand objects
https://bugs.webkit.org/show_bug.cgi?id=152039
<rdar://problem/23816853>
Reviewed by Joseph Pecoraro.
Expand objects logged by console.dir but keep them collapsed when logged by console.log.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
2019-08-22 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Cleanup some unused code
https://bugs.webkit.org/show_bug.cgi?id=201041
Reviewed by Alex Christensen.
* UserInterface/Views/CPUUsageCombinedView.css:
(.cpu-usage-combined-view > .graph > .stacked-area-chart):
* UserInterface/Views/CPUUsageCombinedView.js:
(WI.CPUUsageCombinedView):
* UserInterface/Views/MediaTimelineOverviewGraph.js:
(WI.MediaTimelineOverviewGraph):
2019-08-22 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Provide an engineering option to log protocol traffic as text
https://bugs.webkit.org/show_bug.cgi?id=200969
Reviewed by Devin Rousso.
* UserInterface/Base/Setting.js:
* UserInterface/Protocol/LoggingProtocolTracer.js:
(WI.LoggingProtocolTracer.prototype._processEntry):
(WI.LoggingProtocolTracer):
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
2019-08-21 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: DOM outline in Elements tab should be LTR
https://bugs.webkit.org/show_bug.cgi?id=200601
Reviewed by Timothy Hatcher.
Make DOM outlines in Console and Elements tab always LTR,
and unsure that Left and Right arrow keys continue working correctly.
* UserInterface/Base/Main.js:
(WI.resolveLayoutDirectionForElement): Added.
The existing WI.resolvedLayoutDirection function returns the value of the root DOM element.
The newly added resolveLayoutDirectionForElement function returns the correct value for any element,
including elements with `dir=ltr` inside of `<body dir=rtl>`.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li:matches(.hovered, .selected) + ol.children.expanded):
(.tree-outline.dom li:not(.editing)):
(.tree-outline.dom li.editing):
(.tree-outline.dom li .pseudo-class-indicator):
(.tree-outline.dom.single-node li):
(.tree-outline.dom li.parent):
(.tree-outline.dom li .html-tag.close):
(.tree-outline.dom li.parent::before):
(.tree-outline.dom li.parent.shadow::after):
Remove RTL logic.
* UserInterface/Views/DOMTreeOutline.js:
* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._treeKeyDown):
Make Left and Right arrow keys work correctly for LTR DOM outlines inside of the global RTL.
2019-08-21 Devin Rousso <drousso@apple.com>
Web Inspector: Page: re-add enable/disable after r248454
https://bugs.webkit.org/show_bug.cgi?id=200947
Reviewed by Joseph Pecoraro.
We shouldn't design the agent system with only Web Inspector in mind. Other clients may want
to have different functionality, not being told about frames creation/updates/destruction.
In these cases, we should have graceful error message failures for other agents that rely on
the Page agent.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):
2019-08-21 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: increase the filter bar's width when it's focused if a resource type filter is active
https://bugs.webkit.org/show_bug.cgi?id=200940
Reviewed by Joseph Pecoraro.
* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype._handleFilterChanged):
(WI.FilterBar.prototype.get indicatingProgress): Deleted.
(WI.FilterBar.prototype.set indicatingProgress): Deleted.
(WI.FilterBar.prototype.get indicatingActive): Deleted.
(WI.FilterBar.prototype.set indicatingActive): Deleted.
If escape is pressed when the <input> is empty, unfocus (blur) the <input>.
Drive-by: remove unused/unnecessary functions.
* UserInterface/Views/FilterBar.css:
(.filter-bar > input[type="search"]):
(:matches(.filter-bar, .search-bar) > input[type="search"]): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:matches(:focus, :not(:placeholder-shown))): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::-webkit-search-decoration): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::-webkit-search-results-button): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]::placeholder): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:matches(:not(:focus), :placeholder-shown)::-webkit-search-cancel-button): Added.
(:matches(.filter-bar, .search-bar) > .navigation-bar + input[type="search"]): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:focus): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"] + :empty): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"]:focus ~ *): Added.
(:matches(.filter-bar, .search-bar) > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Added.
(.filter-bar > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Deleted.
(.filter-bar > .navigation-bar + input[type="search"]): Deleted.
(.filter-bar > input[type="search"]::placeholder): Deleted.
(.filter-bar > input[type="search"]:focus): Deleted.
(.filter-bar > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar.active > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar.indicating-progress > input[type="search"]::-webkit-search-decoration): Deleted.
(.filter-bar > input[type="search"] + .navigation-bar:empty): Deleted.
When the <input> is `:focus`, hide the following `WI.NavigationBar` (if it's being used) so
that there's more room to show the filter text.
Drive-by: fix background, border, and text color styling when `:focus`.
* UserInterface/Views/SearchBar.css:
(.search-bar > input[type="search"]):
(.search-bar > input[type="search"]::placeholder): Deleted.
(.search-bar > input[type="search"]:focus): Deleted.
(.search-bar > input[type="search"]:not(:placeholder-shown)): Deleted.
(.search-bar > input[type="search"]:placeholder-shown::-webkit-search-cancel-button): Deleted.
(@media (prefers-color-scheme: dark)): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"],): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"]::placeholder): Deleted.
(:matches(.search-bar, .filter-bar) > input[type="search"]:focus): Deleted.
* UserInterface/Views/SearchSidebarPanel.css:
(.sidebar > .panel.navigation.search > .search-bar):
(.sidebar > .panel.navigation.search > .search-bar > input[type="search"]):
(.sidebar > .panel.navigation.search > .search-bar > .search-settings): Added.
(.sidebar > .panel.navigation.search > .search-bar > input[type="search"]::-webkit-search-results-button): Deleted.
* UserInterface/Views/Toolbar.css:
(.toolbar .search-bar > input[type="search"]::-webkit-textfield-decoration-container): Deleted.
Move shared styles to FilterBar.css as `WI.FilterBar` are more common.
* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark) :root):
Expose some CSS variables in light mode that were previously only defined in dark mode.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._updateFilteredEntries):
(WI.NetworkTableContentView.prototype._updateURLFilterActiveIndicator): Deleted.
* UserInterface/Images/FilterFieldActiveGlyph.svg: Removed.
2019-08-21 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove unnecessary properties on SVGs
https://bugs.webkit.org/show_bug.cgi?id=200968
Reviewed by Devin Rousso.
* UserInterface/Images/EventPause.svg:
* UserInterface/Images/EventPlay.svg:
* UserInterface/Images/EventProcessing.svg:
* UserInterface/Images/EventStop.svg:
* UserInterface/Images/MediaInstrument.svg:
2019-08-20 Devin Rousso <drousso@apple.com>
Web Inspector: Implement `queryHolders` Command Line API
https://bugs.webkit.org/show_bug.cgi?id=200458
Reviewed by Joseph Pecoraro.
Call `queryHolders(object)` from the Console to return an array of objects that strongly
reference the given `object`. This could be very useful for finding JavaScript "leaks".
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2019-08-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Address a few Esprima issues preventing pretty printing of resources
https://bugs.webkit.org/show_bug.cgi?id=200935
Reviewed by Timothy Hatcher.
Address a few Esprima issues:
Issue #1991 - Failure to parse template literal with destructuring assignment expression
https://github.com/jquery/esprima/issues/1991
Issue #1920 - Invalid Left Hand Side in for-in
https://github.com/jquery/esprima/issues/1920
* UserInterface/External/Esprima/esprima.js:
2019-08-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Update CodeMirror to support numeric separators in JavaScript numbers
https://bugs.webkit.org/show_bug.cgi?id=200942
Cherry-pick a few CodeMirror changes:
[javascript mode] Support numeric separators
https://github.com/codemirror/CodeMirror/commit/beab8ed123683416bfec934df73d13401ec086b5#diff-9812850bb71d31e8dd60b476abb2bae8
[javascript mode] fix tokenizing of underscore properties
https://github.com/codemirror/CodeMirror/commit/463ea2c34ab442c0cae1d9732305219ca9b04dfe#diff-9812850bb71d31e8dd60b476abb2bae8
Reviewed by Timothy Hatcher.
* UserInterface/External/CodeMirror/javascript.js:
2019-08-20 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: move the resource type scope bar to be next to the filter
https://bugs.webkit.org/show_bug.cgi?id=200891
Reviewed by Joseph Pecoraro.
It's odd to have UI for controlling the active filters in two different places. Move the
resource type `WI.ScopeBar` to the filter bar area, and "promote" the resource grouping mode
items from a context menu to an always visible `WI.ScopeBar` in the space left by the
resource type `WI.ScopeBar` (switching between grouping modes quickly is a useful workflow).
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.hasCustomFilters):
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeScopeBarSelectionChanged): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
(WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu.addOption): Deleted.
(WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .filter-bar .sources-resource-type-scope-bar.default-item-selected:not(:hover)): Added.
(.sidebar > .panel.navigation.sources > .filter-bar .sources-resource-type-scope-bar.default-item-selected:hover): Added.
* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype.addFilterNavigationItem): Added.
(WI.FilterBar.prototype.addFilterBarButton):
* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item):
(.filter-bar > .navigation-bar > .item.button): Added.
(.filter-bar > .navigation-bar > .item.scope-bar): Added.
(.filter-bar > input[type="search"] + .navigation-bar > .item.scope-bar:last-child): Added.
Provide a way to add arbitrary `WI.NavigationItem` to the contained `WI.NavigationBar`.
Slightly adjust the spacing of the items (depending on their type) in the `WI.NavigationBar`
so they are all centered.
* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(.scope-bar > li):
(.scope-bar > li::after):
(.scope-bar > li:not(.selected):hover): Added.
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
(.scope-bar > li:not(.selected):hover::after): Added.
Introduce CSS variables for `margin`, `padding`, and `opacity` that callers can override to
customize the appearance of the `WI.ScopeBar`.
* Localizations/en.lproj/localizedStrings.js:
2019-08-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Sources: Give Origins their own icon in the Sources sidebar
https://bugs.webkit.org/show_bug.cgi?id=200683
<rdar://problem/54269044>
Reviewed by Devin Rousso.
* UserInterface/Images/Origin.svg: Added.
* UserInterface/Main.html:
New resources.
* UserInterface/Views/FolderIcon.css:
(.origin-icon .icon):
Light and Dark appearances for Origin icons.
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/OriginTreeElement.js:
(WI.OriginTreeElement):
Very much like a folder with different classes.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
Use OriginTreeElement in a few places.
2019-08-20 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Support for JavaScript BigInt
https://bugs.webkit.org/show_bug.cgi?id=180731
<rdar://problem/36298748>
Reviewed by Devin Rousso.
* UserInterface/External/CodeMirror/javascript.js:
(expressionAllowed):
Cherry-pick BigInt JavaScript mode support from CodeMirror:
https://github.com/codemirror/CodeMirror/pull/5411
* UserInterface/Images/TypeBigInt.svg: Added.
* UserInterface/Views/Variables.css:
(:root):
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css:
(.cm-s-default .cm-number.cm-bigint,):
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property.bigint > .icon):
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot .icon.bigint):
Style BigInt similiar but different from numbers but with
a [B] icon instead of [N].
* UserInterface/Views/FormattedValue.css:
(.formatted-bigint):
* UserInterface/Views/FormattedValue.js:
(WI.FormattedValue.hasSimpleDisplay):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression.populate):
(WI.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedJavaScriptExpression):
Simple value formatting for the new type.
* UserInterface/Models/TypeSet.js:
(WI.TypeSet):
(WI.TypeSet.prototype.get primitiveTypeNames):
* UserInterface/Views/TypeTokenView.css:
(.type-token-bigint):
* UserInterface/Views/TypeTokenView.js:
(WI.TypeTokenView.prototype._displayTypeName):
(WI.TypeTokenView):
New type handling for the Type profiler.
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject):
(WI.RemoteObject.createBigIntFromDescriptionString):
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WI.HeapSnapshotClusterContentView.iconStyleClassNameForClassName):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
BigInt values are not tied to a GlobalObject, so do some special casing
in the Heap output (like Strings) so we get a preview.
2019-08-20 Devin Rousso <drousso@apple.com>
Web Inspector: Use URL constructor to better handle all kinds of URLs
https://bugs.webkit.org/show_bug.cgi?id=165155
Reviewed by Joseph Pecoraro.
* UserInterface/Base/URLUtilities.js:
(parseURL):
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: add a global breakpoint for pausing in the next microtask
https://bugs.webkit.org/show_bug.cgi?id=200652
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.get allMicrotasksBreakpoint): ADded.
(WI.DebuggerManager.prototype.isBreakpointSpecial):
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
(WI.DebuggerManager.prototype._breakpointDisabledStateDidChange):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-microtask-icon .icon): Added.
* UserInterface/Images/Microtask.svg: Added.
* UserInterface/Base/Setting.js:
* Localizations/en.lproj/localizedStrings.js:
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248682): Elements: Computed: go-to arrows in the Variables section are misaligned
https://bugs.webkit.org/show_bug.cgi?id=200841
Reviewed by Joseph Pecoraro.
The Variables section uses a different CSS class since it's identifier changed in r248682.
* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables)): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) .property:not(:hover) .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property .go-to-arrow): Deleted.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property:hover .go-to-arrow): Deleted.
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: have more aggressive checks for dataURLs provided to `console.screenshot`
https://bugs.webkit.org/show_bug.cgi?id=200747
Reviewed by Joseph Pecoraro.
Always send any /data:*+/ strings to the frontend and have it render there. If that doesn't
work, have the frontend "spoof" an error message look and feel.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
* Localizations/en.lproj/localizedStrings.js:
2019-08-19 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: Network headers values should be preserved
https://bugs.webkit.org/show_bug.cgi?id=200873
Reviewed by Joseph Pecoraro.
Replace spans with bdi elements, which have `unicode-bidi: isolate` User Agent style.
This works well with both LTR and RTL values.
* UserInterface/Views/ResourceDetailsSection.js:
(WI.ResourceDetailsSection.prototype.appendKeyValuePair):
Drive-by: remove unnecessary if/else statement and use `append` instead.
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Debugger: pressing delete when the all/uncaught exceptions breakpoint is selected should select the next tree element
https://bugs.webkit.org/show_bug.cgi?id=200876
Reviewed by Joseph Pecoraro.
Removing the `return true;` from the various `WI.TreeElement` breakpoint classes allows the
owner `WI.TreeOutline` to also handle the delete event. In the Debugger/Sources navigation
sidebar, the owner `WI.TreeOutline` checks to see if the currently selected `WI.TreeElement`
is one of the "top" items ("All Exceptions", "Uncaught Exceptions", "Assertion Failures")
and if so, select the next tree element (if able) instead of the previous one.
This is a preferred experience because the "top" items can only be disabled, not deleted, so
trying to delete them wouldn't actually change the selection. They should only ever be
selected if there's nothing else that can be selected.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
(WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Added.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.checkIfSelectionAdjustmentNeeded): Added.
* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.ondelete):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement.prototype.ondelete):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement.prototype.ondelete):
2019-08-19 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: don't show the All Requests breakpoint by default
https://bugs.webkit.org/show_bug.cgi?id=200892
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Setting.js:
2019-08-17 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: gear icons moves to 2nd line when sidebar is narrow
https://bugs.webkit.org/show_bug.cgi?id=198017
Reviewed by Joseph Pecoraro.
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar):
(WI.NavigationBar.prototype.layout):
(WI.NavigationBar.prototype.layout.forceItemHidden): Added.
(WI.NavigationBar.prototype.layout.isDivider): Added.
(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth): Added.
(WI.NavigationBar.prototype.needsLayout): Deleted.
(WI.NavigationBar.prototype.sizeDidChange): Deleted.
(WI.NavigationBar.prototype._updateContent): Deleted.
(WI.NavigationBar.prototype._updateContent.forceItemHidden): Deleted.
(WI.NavigationBar.prototype._updateContent.isDivider): Deleted.
(WI.NavigationBar.prototype._updateContent.calculateVisibleItemWidth): Deleted.
Reset the cached `_minimumWidth` whenever updating in `layout()`.
* UserInterface/Views/NavigationItem.js:
(WI.NavigationItem.prototype.get width):
(WI.NavigationItem.prototype.update): Added.
(WI.NavigationItem.prototype.updateLayout): Deleted.
(WI.NavigationItem.prototype.get totalMargin): Added.
* UserInterface/Views/ButtonNavigationItem.js:
(WI.ButtonNavigationItem.prototype.get totalMargin): Added.
* UserInterface/Views/ButtonNavigationItem.css:
* UserInterface/Views/TextNavigationItem.js:
(WI.TextNavigationItem.prototype.get totalMargin): Added.
* UserInterface/Views/TextNavigationItem.css:
`Element.prototype.getBoundingClientRect` doesn't include the `margin` box of an element.
Rather than create a CSS variable and parse a computed style, save the total `margin` amount
to a getter that can then be added when computing the minimum width.
* UserInterface/Views/Sidebar.js:
(WI.Sidebar):
(WI.Sidebar.prototype._recalculateWidth):
* UserInterface/Views/FlexibleSpaceNavigationItem.js:
(WI.FlexibleSpaceNavigationItem.prototype.update): Added.
(WI.FlexibleSpaceNavigationItem.prototype.updateLayout): Deleted.
* UserInterface/Views/GroupNavigationItem.js:
(WI.GroupNavigationItem.prototype.update): Added.
(WI.GroupNavigationItem.prototype.updateLayout): Deleted.
* UserInterface/Views/HierarchicalPathNavigationItem.js:
(WI.HierarchicalPathNavigationItem.prototype.update): Added.
(WI.HierarchicalPathNavigationItem.prototype.updateLayout): Deleted.
* UserInterface/Views/RadioButtonNavigationItem.js:
(WI.RadioButtonNavigationItem.prototype.update): Added.
(WI.RadioButtonNavigationItem.prototype.updateLayout): Deleted.
Rename `updateLayout` to `update` so it doesn't clash with `WI.View` naming.
* UserInterface/Views/SidebarNavigationBar.js: Removed.
* UserInterface/Main.html:
* UserInterface/Views/NavigationBar.css:
(.navigation-bar .item): Added.
(.navigation-bar .item, .sidebar-navigation-bar > .holder .item): Deleted.
(.sidebar-navigation-bar): Deleted.
(.sidebar-navigation-bar .holder): Deleted.
Remove unnecessary class.
2019-08-16 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Syntax Highlight more CSS media queries
https://bugs.webkit.org/show_bug.cgi?id=200824
Reviewed by Devin Rousso.
* UserInterface/Views/CodeMirrorAdditions.js:
Special case CSS "error" tokenized values from CodeMirror inside @ rules
to treat some as properties.
2019-08-16 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: JavaScript formatting of single statement arrow function can be poor
https://bugs.webkit.org/show_bug.cgi?id=200800
Reviewed by Ross Kirsling.
* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._isLikelyToHaveNewline):
(EsprimaFormatter.prototype._handleTokenAtNode):
Better heuristic for single statement arrow functions.
2019-08-16 Devin Rousso <drousso@apple.com>
Web Inspector: there should be an opposite icon for Eye.svg when we want to hide things instead of showing them
https://bugs.webkit.org/show_bug.cgi?id=200736
Reviewed by Joseph Pecoraro.
We currently use Eye.svg for disabling, or turning "off", Shader Programs, but it's not very
clear that clicking on the eye (which looks like "show me this", not "hide this") will do
that. Furthermore, a greyed out version also isn't clear that the Shader Program is disabled,
instead making the user think that the disable toggle is somehow "not working".
The new hide icon is clearer, as it uses a strikethrough, rather than some shading/greying.
* UserInterface/Views/ShaderProgramTreeElement.css:
(.item.shader-program .status > img):
(.item.shader-program.disabled:matches:hover .status > img): Added.
(.item.shader-program.disabled > :not(.status)): Added.
(.item.shader-program.disabled > *): Deleted.
* UserInterface/Images/Hide.svg: Added.
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property .getter):
* UserInterface/Images/Show.svg: Renamed from UserInterface/Images/Eye.svg.
2019-08-16 Devin Rousso <drousso@apple.com>
Web Inspector: rename "Invalid Characters" to "Invisible Characters" for clarity
https://bugs.webkit.org/show_bug.cgi?id=200808
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
* UserInterface/Base/Main.js:
(setInvisibleCharacterClassName): Added.
(setInvalidCharacterClassName): Deleted.
* UserInterface/Views/CodeMirrorOverrides.css:
(.show-invisible-characters .CodeMirror .cm-invalidchar): Added.
(.show-invalid-characters .CodeMirror .cm-invalidchar): Deleted.
* Localizations/en.lproj/localizedStrings.js:
2019-08-16 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: Console should be always LTR
https://bugs.webkit.org/show_bug.cgi?id=200482
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ConsoleCommandView.js:
(WI.ConsoleCommandView.prototype.render):
* UserInterface/Views/ConsoleMessageView.css:
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
Make console messages always LTR.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._keyDown):
Since the console is always LTR now, we can remove code that flips left and right
arrow keys.
* UserInterface/Views/ObjectTreeView.css:
JS objects should always be LTR.
* UserInterface/Views/TreeElement.js:
Look at "direction" CSS property because Element's text direction can be LTR even
when `WI.resolvedLayoutDirection()` is RTL.
(WI.TreeElement.prototype.isEventWithinDisclosureTriangle):
* UserInterface/Views/TreeOutline.css:
(body[dir=ltr] .tree-outline .item :matches(.disclosure-button, .icon),):
(body[dir=rtl] [dir=ltr] .tree-outline .item .disclosure-button):
2019-08-16 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: setting a breakpoint on a specific listener should enable the event listener
https://bugs.webkit.org/show_bug.cgi?id=200551
Reviewed by Joseph Pecoraro.
* UserInterface/Views/EventListenerSectionGroup.js:
(WI.EventListenerSectionGroup):
2019-08-15 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Update Esprima to support modern JavaScript language features
https://bugs.webkit.org/show_bug.cgi?id=200796
Reviewed by Ross Kirsling.
Use a fork of Esprima to support modern JavaScript language features
while going through the process to upstream support:
ES2018 Feature: Async Iteration (for-await-of)
https://github.com/jquery/esprima/issues/1990
ES2019 Feature: Numeric Separator
https://github.com/jquery/esprima/issues/1989
ES2019 Feature: Optional catch binding
https://github.com/jquery/esprima/issues/1953
ES2020 Feature: BigInt
https://github.com/jquery/esprima/issues/1988
ESTree compatible AST changes are summarized as:
- CatchClause `param` property is now nullable
- ForOfStatement now has a boolean `await` property
- Literal can be a `"bigint"` type (works if the environment has BigInt or not)
The pretty printer only needed to have additional handling for `for-await-of`.
* UserInterface/External/Esprima/esprima.js:
New version. Typescript output expects a modern JavaScript environment
instead of just ES6.
* Tools/Formatting/index.html:
Update the formatting tool for easier use in case of errors.
* UserInterface/Models/ScriptSyntaxTree.js:
(WI.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.passOrFail):
Convenience for pass/fail with the same message based on a condition.
* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):
Ensure a space after `await` in `for await` syntax.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r244268): "Show Scope Chain on pause" setting has no effect
https://bugs.webkit.org/show_bug.cgi?id=200797
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DebuggerTabContentView.js:
(WI.DebuggerTabContentView.prototype.showDetailsSidebarPanels):
* UserInterface/Views/SourcesTabContentView.js:
(WI.SourcesTabContentView.prototype.showDetailsSidebarPanels):
When the sidebar panel isn't visible `parentSidebar` is `null`. Use `WI.DetailsSidebar` instead.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'this._resource.initiatorSourceCodeLocation')
https://bugs.webkit.org/show_bug.cgi?id=200798
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
(WI.ResourceDetailsSidebarPanel.prototype.set resource):
(WI.ResourceDetailsSidebarPanel.prototype.layout):
Cancel the `Throttler` whenever the `_resource` is updated, as otherwise the `Throttler` may
fire later on with an unset `_resource`.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: provide a way to create an arbitrary Inspector Style Sheet
https://bugs.webkit.org/show_bug.cgi?id=200425
Reviewed by Joseph Pecoraro.
Right now, the only way to create an Inspector Style Sheet is by creating a new rule in the
Styles sidebar of the Elements Tab. This is unnecessarily restrictive, especially for those
who don't use the Elements tab.
Add a + button after the filter bar in the Navigation sidebar. Clicking on the + button will
show a menu with the following (more likely to be added later):
- Inspector Style Sheet
- Frames (if there are subframes)
- (name of subframe)
- Inspector Style Sheet
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.treeElementForRepresentedObject): Added.
(WI.SourcesNavigationSidebarPanel.prototype._filterByResourcesWithIssues): Added.
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._updateMainFrameTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addResource):
(WI.SourcesNavigationSidebarPanel.prototype._handleTreeSelectionDidChange):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateResourceContextMenu): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeChanged):
(WI.SourcesNavigationSidebarPanel.prototype._handleFrameWasAdded): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleMainFrameDidChange): Deleted.
* UserInterface/Views/GeneralTreeElement.js:
(WI.GeneralTreeElement.prototype.createFoldersAsNeededForSubpath):
Drive-by: sort `WI.ResourceTreeElement`s alongside `WI.FolderTreeElement`s for easier readability.
* UserInterface/Views/FrameTreeElement.js:
(WI.FrameTreeElement.prototype.onpopulate):
Add all `inspectorStyleSheetsForFrame` instead of just the preferred one so that they all
are visible/selectable for editing.
* UserInterface/Views/FilterBar.js:
(WI.FilterBar):
* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item):
(.filter-bar > input[type="search"]):
(.filter-bar > .navigation-bar + input[type="search"]): Added.
(.filter-bar > input[type="search"] + .navigation-bar:empty): Added.
Move the position of the filter bar buttons to be after the filter bar itself, so that other
parents can add action items before the filter bar to keep a consistent positioning.
- to the left of the filter bar are action items (e.g. "+")
- the filter bar itself
- to the right of the filter bar are filter buttons (e.g. "filter by resoure with issue")
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.get frames):
Drive-by: use `Array.from`, instead of `[...map.values()]`.
* UserInterface/Models/Frame.js:
(WI.Frame.prototype.get url):
(WI.Frame.prototype.get urlComponents): Added.
* UserInterface/Base/URLUtilities.js.js:
(parseURL):
Calculate and include the `origin` string with the output.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.preferredInspectorStyleSheetForFrame):
Remove `doNotCreateIfMissing` now that the last caller has been removed.
* Localizations/en.lproj/localizedStrings.js:
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: CodeMirror still inserts a tab even when "Prefer indent using" is set to "Spaces"
https://bugs.webkit.org/show_bug.cgi?id=200770
Reviewed by Ross Kirsling.
* UserInterface/Views/CodeMirrorAdditions.js:
Remap the `insertTab` command to use `insertSoftTab` when "Prefer indent using" is set to
"Spaces" so that CodeMirror inserts the number of spaces that would match a tab ("\t") being
inserted at the same spot.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: the "No Filter Results" message sits on top of all of the content, preventing any interaction
https://bugs.webkit.org/show_bug.cgi?id=200755
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .resources-container): Added.
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources-container)): Added.
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .call-stack-container):
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .breakpoints-container):
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .resources-container): Added.
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources)): Deleted.
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .resources): Deleted.
Wrap the resources `WI.TreeOutline` in a <div> so the empty message placeholder that gets
inserted after it can be constrained to the size of the `WI.TreeOutline`.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Layers: background of 3D area doesn't update when transitioning to/from Dark mode
https://bugs.webkit.org/show_bug.cgi?id=200775
Reviewed by Ross Kirsling.
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView.prototype.initialLayout):
Add a `matchMedia` listener for `(prefers-color-scheme: dark)` and update the clear color
of the WebGL renderer whenever it changes.
* UserInterface/Views/ErrorObjectView.css:
(@media (prefers-color-scheme: dark)): Added.
(@media (prefers-dark-interface)): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(@media (prefers-color-scheme: dark)): Added.
(@media (prefers-dark-interface)): Deleted.
Drive-by: replace older `prefers-dark-interface` with modern `prefers-color-scheme: dark`.
2019-08-15 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Update Esprima to trunk (minor fixes)
https://bugs.webkit.org/show_bug.cgi?id=200691
<rdar://problem/54276170>
Rubber-stamped by Devin Rousso.
* UserInterface/External/Esprima/esprima.js:
Updated to jquery/esprima@5e55171feb5adbc2b1d28ef4b2628d5ea9af0848.
* UserInterface/Models/ScriptSyntaxTree.js:
(WI.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration.gatherIdentifiers):
(WI.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration):
(WI.ScriptSyntaxTree.prototype._recurse):
(WI.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
(WI.ScriptSyntaxTree):
* UserInterface/Workers/Formatter/ESTreeWalker.js:
(ESTreeWalker.prototype._walkChildren):
(ESTreeWalker):
* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):
- SpreadProperty => SpreadElement.
- RestProperty => RestElement.
2019-08-15 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Content request failed.
https://bugs.webkit.org/show_bug.cgi?id=200704
<rdar://problem/54279372>
Reviewed by Brian Burg.
* UserInterface/Models/WebSocketResource.js:
(WI.WebSocketResource.prototype.requestContentFromBackend): Added.
Add an "assert not reached", as WebSocket resources don't really have "content", instead
having a list of send/receive frames.
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
Don't attempt to request the content of any `WI.WebSocketResource` for the reason above.
2019-08-14 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Computed: move the Box Model section to the top
https://bugs.webkit.org/show_bug.cgi?id=200555
Reviewed by Joseph Pecoraro.
For nodes that use a lot of different CSS properties, having the Box Model section all the
way at the bottom isn't as useful for taking a quick glance at the node's box model data.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
2019-08-14 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Computed: the collapsed state of the Variables section should be separate from the collapsed state of the Properties section
https://bugs.webkit.org/show_bug.cgi?id=200725
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
Use a different identifier string for the Variable section so it preserves its own collapsed
collapsed state independent of the Properties section.
2019-08-14 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Computed: the background of the Properties/Variables sections should match the Box Model section when expanded
https://bugs.webkit.org/show_bug.cgi?id=200724
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content > .computed > .details-section:not(.collapsed) > :matches(.header, .content)): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .computed-style-properties .property:hover .go-to-arrow): Added.
(.sidebar > .panel.details.css-style > .content > .computed .details-section:matches(.computed-style-properties, .computed-style-variables) > .content): Added.
(.details-section:matches(.computed-style-properties, .computed-style-box-model):not(.collapsed) > :matches(.header, .content)): Deleted.
(.computed-style-properties): Deleted.
(.computed-style-properties .property .go-to-arrow): Deleted.
(.computed-style-properties .property:hover .go-to-arrow): Deleted.
(.details-section.computed-style-properties:not(.collapsed) > :matches(.header, .content)): Deleted.
(.details-section.computed-style-properties > .content): Deleted.
(@media (prefers-color-scheme: dark)): Deleted.
Use more specific selectors to match overall Web Inspector style.
* UserInterface/Views/ComputedStyleSection.css:
(.computed-style-section .computed-property-item.expanded):
Darken the background of any expanded computed property in light mode.
2019-08-13 Joseph Pecoraro <pecoraro@apple.com>
Uncaught Exception: content.isJSON is not a function selecting image resource
https://bugs.webkit.org/show_bug.cgi?id=200680
Reviewed by Devin Rousso.
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._canUseJSONContentViewForContent):
Protect against non-string data, such as Blob response content.
2019-08-13 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: show @supports CSS groupings
https://bugs.webkit.org/show_bug.cgi?id=200419
<rdar://problem/53971948>
Reviewed by Joseph Pecoraro.
* UserInterface/Models/CSSGrouping.js: Renamed from Source/WebInspectorUI/UserInterface/Models/CSSMedia.js.
(WI.CSSGrouping):
(WI.CSSGrouping.prototype.get type):
(WI.CSSGrouping.prototype.get text):
(WI.CSSGrouping.prototype.get sourceCodeLocation):
(WI.CSSGrouping.prototype.get isMedia): Added.
(WI.CSSGrouping.prototype.get isSupports): Added.
(WI.CSSGrouping.prototype.get prefix): Added.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.get groupings): Added.
(WI.CSSStyleDeclaration.prototype.generateCSSRuleString):
(WI.CSSStyleDeclaration.prototype.get mediaList): Deleted.
* UserInterface/Models/CSSRule.js:
(WI.CSSRule):
(WI.CSSRule.prototype.get groupings): Added.
(WI.CSSRule.prototype.update):
(WI.CSSRule.prototype._selectorResolved):
(WI.CSSRule.prototype.get mediaList): Deleted.
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseRulePayload):
(WI.DOMNodeStyles.prototype.rulesForSelector): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleEditorFilterApplied):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._createMediaHeader): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration :matches(.header, .header-groupings)): Added.
(.spreadsheet-css-declaration :matches(.header, .header-groupings):first-child): Added.
(.spreadsheet-css-declaration .header-groupings > .grouping): Added.
(.spreadsheet-css-declaration :matches(.header, .header-media)): Deleted.
(.spreadsheet-css-declaration :matches(.header, .header-media):first-child): Deleted.
(.spreadsheet-css-declaration .media-label): Deleted.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.protocolGroupingTypeToEnum): Added.
(WI.CSSManager.protocolMediaSourceToEnum): Deleted.
* UserInterface/Main.html:
* UserInterface/Test.html:
2019-08-12 Devin Rousso <drousso@apple.com>
REGRESSION(r248391): Web Inspector: changing Layout Direction Debug setting no longer adds dir="ltr" to body element
https://bugs.webkit.org/show_bug.cgi?id=200564
Reviewed by Joseph Pecoraro.
`WI.resolvedLayoutDirection` was called before `WI.runBootstrapOperations`, which is what
instantiates `WI.showDebugUISetting`. Without it, `WI.resolvedLayoutDirection` will ignore
the value of `WI.settings.debugLayoutDirection` and instead use the system.
Moving the instantiation of `WI.showDebugUISetting` outside `WI.runBootstrapOperations`
allows the setting to be created when the Bootstrap.js script is loaded, rather than after
the `DOMContentLoaded` event is fired. This means that it's guaranteed to exist before any
interface/view code runs.
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
2019-08-12 Devin Rousso <drousso@apple.com>
Web Inspector: remove WI.DeprecatedRemoteObjectProperty
https://bugs.webkit.org/show_bug.cgi?id=200549
Reviewed by Joseph Pecoraro.
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.deprecatedGetOwnProperties): Deleted.
(WI.RemoteObject.prototype.deprecatedGetAllProperties): Deleted.
(WI.RemoteObject.prototype.deprecatedGetDisplayableProperties): Deleted.
(WI.RemoteObject.prototype._deprecatedGetProperties): Deleted.
(WI.RemoteObject.prototype._deprecatedGetPropertiesResolver): Deleted.
(WI.DeprecatedRemoteObjectProperty): Deleted.
(WI.DeprecatedRemoteObjectProperty.prototype.fromPrimitiveValue): Deleted.
* UserInterface/Models/CallFrame.js:
(WI.CallFrame.prototype.collectScopeChainVariableNames):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype._refreshProperties):
2019-08-12 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248201): DOMDebugger: unable to add event breakpoint when All Events breakpoint is enabled
https://bugs.webkit.org/show_bug.cgi?id=200561
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
2019-08-12 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: DOMDebugger: breakpoints are forcibly enabled when resolving DOM breakpoints for newly added nodes
https://bugs.webkit.org/show_bug.cgi?id=200639
Reviewed by Joseph Pecoraro.
Since DOM breakpoints revolve around a given DOM node, we attempt to restore DOM breakpoints
whenever new nodes are added by matching them to the path of the DOM breakpoint. When doing
so, we should be in a "temporarily restoring breakpoints" mode so that we don't forcibly
enable all breakpoints.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL):
(WI.DOMDebuggerManager.prototype._nodeInserted):
2019-08-12 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: add space between media query and style icon
https://bugs.webkit.org/show_bug.cgi?id=200623
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration .header:not(:first-child), .spreadsheet-css-declaration .header:not(.editing-selector) .selector, .spreadsheet-css-declaration.has-icon .header.editing-selector .selector): Added.
(.spreadsheet-css-declaration .header.editing-selector .selector): Deleted.
Ensure the selector field doesn't shift vertically when entering/exiting editing mode.
2019-08-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Address some ESLint warnings
https://bugs.webkit.org/show_bug.cgi?id=200598
Reviewed by Devin Rousso.
* UserInterface/Base/Utilities.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Models/DOMNodeStyles.js:
* UserInterface/Models/LayoutTimelineRecord.js:
* UserInterface/Models/ServerTimingEntry.js:
* UserInterface/Models/TimelineRecording.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Test/FrontendTestHarness.js:
* UserInterface/Test/Test.js:
* UserInterface/Views/CPUTimelineView.js:
* UserInterface/Views/CPUUsageCombinedView.js:
* UserInterface/Views/ChangesDetailsSidebarPanel.js:
* UserInterface/Views/DOMTreeContentView.js:
* UserInterface/Views/DOMTreeElement.js:
* UserInterface/Views/DebuggerSidebarPanel.js:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/ResourceTimingBreakdownView.js:
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
* UserInterface/Views/TreeOutline.js:
2019-08-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Better organize manager / observer API groups
https://bugs.webkit.org/show_bug.cgi?id=200594
Reviewed by Devin Rousso.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.globalObjectCleared):
(WI.DebuggerManager.prototype.reset): Deleted.
Renamed.
* UserInterface/Protocol/DebuggerObserver.js:
(WI.DebuggerObserver.prototype.globalObjectCleared):
* UserInterface/Controllers/CSSManager.js:
* UserInterface/Controllers/CanvasManager.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Controllers/DOMManager.js:
* UserInterface/Controllers/DOMStorageManager.js:
* UserInterface/Controllers/LayerTreeManager.js:
* UserInterface/Controllers/NetworkManager.js:
* UserInterface/Controllers/TargetManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Controllers/WorkerManager.js:
2019-08-10 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248454): WK1 inspector frontend client doesn't queue messages to the frontend before it's loaded
https://bugs.webkit.org/show_bug.cgi?id=200587
Reviewed by Joseph Pecoraro.
WK1 inspector sends messages to the frontend using `WebCore::InspectorClient::doDispatchMessageOnFrontendPage`,
which does not do any sort of queueing to wait until the frontend is loaded (`InspectorFrontendHost.loaded()`).
Now that we are sending messages immediately, we should always queue.
* UserInterface/Test/TestStub.js:
(InspectorFrontendAPI.dispatch): Added.
* UserInterface/Models/Frame.js:
(WI.Frame.prototype.markDOMContentReadyEvent):
(WI.Frame.prototype.markLoadEvent):
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
(WI.TimelineManager.prototype.pageLoadEventFired):
2019-08-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Node details sidebar sections have unclear delineation in Dark Mode
https://bugs.webkit.org/show_bug.cgi?id=200603
<rdar://problem/54146925>
Reviewed by Devin Rousso.
* UserInterface/Views/DetailsSection.css:
(@media (prefers-color-scheme: dark)):
(.details-section .details-section,):
Give a details section header a different color than a normal sidebar header.
2019-08-09 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r248480): Sources: the Pause Reason section takes the entire vertical space when there are few breakpoints/resources
https://bugs.webkit.org/show_bug.cgi?id=200597
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(@media (min-height: 650px) .sidebar > .panel.navigation.sources > .content > .pause-reason-container): Deleted.
Don't `flex-grow` or `flex-shrink` the Pause Reason section so it always displays its full
content. The rest of the sections can grow/shrink as needed.
2019-08-09 Devin Rousso <drousso@apple.com>
REGRESSION (Safari 6): Web Inspector: JSON may not be pretty printed if served as text/html
https://bugs.webkit.org/show_bug.cgi?id=122898
<rdar://problem/15241419>
Reviewed by Joseph Pecoraro.
Check the request/response data to see if it's JSON parsable. If so, allow the user to elect
to view the request/response as a JSON preview instead of raw (or pretty printed) text.
Prefer the JSON view wherever possible.
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView):
(WI.ResourceClusterContentView.prototype.get requestContentView):
(WI.ResourceClusterContentView.prototype.get customRequestContentView): Added.
(WI.ResourceClusterContentView.prototype.get customResponseContentView):
(WI.ResourceClusterContentView.prototype.get selectionPathComponents):
(WI.ResourceClusterContentView.prototype.showRequest):
(WI.ResourceClusterContentView.prototype._canShowCustomRequestContentView): Added.
(WI.ResourceClusterContentView.prototype._canShowCustomResponseContentView):
(WI.ResourceClusterContentView.prototype._contentViewForResourceType):
(WI.ResourceClusterContentView.prototype._pathComponentForContentView):
(WI.ResourceClusterContentView.prototype._identifierForContentView):
(WI.ResourceClusterContentView.prototype._showContentViewForIdentifier):
(WI.ResourceClusterContentView.prototype._canUseJSONContentViewForContent): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomRequestContentView): Added.
(WI.ResourceClusterContentView.prototype._tryEnableCustomResponseContentView):
(WI.ResourceClusterContentView.prototype.saveToCookie): Deleted.
(WI.ResourceClusterContentView.prototype._customContentViewConstructorForResource): Deleted.
Since the current view is already saved in a `WI.Setting`, there's no need to save that
state to a cookie, as it'll be restored elsewhere.
* UserInterface/Base/Main.js:
(WI.showResourceRequest):
* UserInterface/Main.html:
* UserInterface/Views/JSONContentView.js: Added.
(WI.JSONContentView):
(WI.JSONContentView.prototype.initialLayout):
(WI.JSONContentView.prototype.attached):
(WI.JSONContentView.prototype.closed):
* UserInterface/Views/JSONContentView.css: Added.
(.content-view.json):
* Source/WebInspectorUI/UserInterface/Views/JSONResourceContentView.js: Deleted.
* Source/WebInspectorUI/UserInterface/Views/JSONResourceContentView.css: Deleted.
Create a more generic content view that shows a preview for the given JSON parsable string.
* UserInterface/Base/Utilities.js:
(String.prototype.isJSON): Added.
* UserInterface/Views/WebSocketDataGridNode.js:
(WI.WebSocketDataGridNode.prototype.appendContextMenuItems):
Utility function for checking if a string is JSON parsable.
* Localizations/en.lproj/localizedStrings.js:
2019-08-09 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: increase the vertical space allocated to the call stack when paused
https://bugs.webkit.org/show_bug.cgi?id=200236
Reviewed by Joseph Pecoraro.
Rather than uniformly constrict the height of the Call Stack and Breakpoints sections, they
should "flex" based on their importance, which can likely be derived from the current state.
This way, it's possible to see information from each section at the same time, but still
have enough space in each section to be able to do something useful.
When paused, the most useful data is the call stack, so give the Call Stack section the most
vertical space (the Pause Reason is also important, but it usually needs very little space).
When not paused, it's likely that the user cares more about the resources with breakpoints
than those without, so favor the Breakpoints section.
Each section will only expand to fit it's maximum content height.
If the inspector window becomes too short, remove the "flex" entirely and have all the
content be part of a single scroll area instead.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerPaused):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerResumed):
(WI.SourcesNavigationSidebarPanel.prototype._handleCallStackElementAddedOrRemoved): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > :matches(.pause-reason-container, .call-stack-container, .breakpoints-container)): Added.
(.sidebar > .panel.navigation.sources > .content .details-section): Added.
(.sidebar > .panel.navigation.sources > .content .details-section.collapsed > .header > .options, .sidebar > .panel.navigation.sources > .content .details-section:not(.collapsed) > .content, .sidebar > .panel.navigation.sources > .content .details-section:not(.collapsed) > .content > .group): Added.
(.sidebar > .panel.navigation.sources > .content > .breakpoints-container .create-breakpoint): Added.
(.sidebar > .panel.navigation.sources > .content > .navigation-bar): Added.
(@media (min-height: 650px)): Added.
(.sidebar > .panel.navigation.sources > .content > .pause-reason-container): Added.
(.sidebar > .panel.navigation.sources > .content > :matches(.call-stack-container, .breakpoints-container, .resources)): Added.
(.sidebar > .panel.navigation.sources > .content > .call-stack-container): Added.
(.sidebar > .panel.navigation.sources > .content > .breakpoints-container): Added.
(.sidebar > .panel.navigation.sources > .content > .resources): Added.
(.sidebar > .panel.navigation.sources > .content > .breakpoints-container .tree-outline .item.event-target-window .icon): Added.
(.sidebar > .panel.navigation.sources > .content > .details-section): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.paused-reason, .breakpoints).collapsed > .header > .options,): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.collapsed > .content): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints > .header > .options .create-breakpoint): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.pause-reason, .call-stack, .breakpoints) > .content,): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints) > .content): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.call-stack): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .create-breakpoint): Deleted.
(@media (min-height: 600px)): Deleted.
(.sidebar > .panel.navigation.sources > .content > .pause-reason): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section:matches(.call-stack, .breakpoints):not(.collapsed) > .content,): Deleted.
(.sidebar > .panel.navigation.sources > .content > .details-section.breakpoints .tree-outline .item.event-target-window .icon): Deleted.
Wrap the Pause Reason, Call Stack, and Breakpoints `WI.DetailsSection`s in a container
element so that the styling of the sticky header doesn't get affected by the clamping of the
container's height.
* UserInterface/Views/DetailsSection.css:
(.details-section):
(.details-section > .header):
Create CSS variables for styles that will be overridden by the Sources navigation sidebar.
2019-08-08 Devin Rousso <drousso@apple.com>
Web Inspector: Page: don't allow the domain to be disabled
https://bugs.webkit.org/show_bug.cgi?id=200109
Reviewed by Brian Burg.
The `PageAgent` is relied on by many of the other agents, so much so that it doesn't make
sense to support the ability to "disable" (as well as "enable") the agent.
When the first frontend connects, we should treat the `PageAgent` as active and available.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype.initializeTarget):
* Test/Test.js:
(WI.loaded):
(WI.initializeBackendTarget):
(WI.contentLoaded):
(WI.targetsAvailable): Added.
(WI.whenTargetsAvailable): Added.
* Test/TestStub.js:
Ensure that the backend always gets notified via `InspectorFrontendHost.loaded` so that
messages being sent to the frontend are batched.
2019-08-08 Devin Rousso <drousso@apple.com>
Web Inspector: rename `queryObjects` to `queryInstances` for clarity
https://bugs.webkit.org/show_bug.cgi?id=200520
Reviewed by Brian Burg.
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
2019-08-07 Devin Rousso <drousso@apple.com>
Fix construction of `WI.EventBreakpoint` after r248201
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.setBreakpointForEventListener):
2019-08-07 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: add an Engineering pane to expose useful settings for other WebKit engineers
https://bugs.webkit.org/show_bug.cgi?id=200492
Reviewed by Joseph Pecoraro.
Other WebKit engineers might find being able to see internal objects or pause in internal
scripts useful, so we should allow them to do so without having to enable Web Inspector's
debug "mode".
A new "Engineering" pane is added to the Settings Tab:
- Debugging
- Show WebKit-internal scripts
- Pause in WebKit-internal scripts
- Heap Snapshot
- Show Internal Objects
- Show Private Symbols
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createEngineeringSettingsView): Added.
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
* UserInterface/Base/Main.js:
(WI.resolvedLayoutDirection):
(WI.setLayoutDirection):
* UserInterface/Base/Object.js:
* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.set dumpInspectorProtocolMessages):
(InspectorBackendClass.prototype.get dumpInspectorProtocolMessages):
(InspectorBackendClass.prototype.set dumpInspectorTimeStats):
(InspectorBackendClass.prototype.get dumpInspectorTimeStats):
(InspectorBackendClass.prototype.set filterMultiplexingBackendInspectorProtocolMessages):
(InspectorBackendClass.prototype.get filterMultiplexingBackendInspectorProtocolMessages):
* UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.prototype.findFunctionSourceCodeLocation):
* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):
* UserInterface/Debug/UncaughtExceptionReporter.js:
(handleUncaughtExceptionRecord):
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype.initializeTarget):
(WI.DebuggerManager.prototype.get knownNonResourceScripts):
(WI.DebuggerManager.prototype.debuggerDidPause):
(WI.DebuggerManager.prototype.scriptDidParse):
(WI.DebuggerManager.prototype._handleEngineeringShowInternalScriptsSettingChanged): Added.
(WI.DebuggerManager.prototype._handleEngineeringPauseForInternalScriptsSettingChanged): Added.
(WI.DebuggerManager.prototype._pauseForInternalScriptsDidChange): Deleted.
(WI.DebuggerManager.prototype._debugUIEnabledDidChange): Deleted.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendLocationLink):
* UserInterface/Views/HeapSnapshotDataGridTree.js:
(WI.HeapSnapshotInstancesDataGridTree.prototype.populateTopLevel):
* UserInterface/Views/OpenResourceDialog.js:
(WI.OpenResourceDialog.prototype._addScriptsForTarget):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/StackTraceView.js:
(WI.StackTraceView):
* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):
2019-08-07 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: content of Variables section should always be LTR
https://bugs.webkit.org/show_bug.cgi?id=200481
Reviewed by Devin Rousso.
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WI.ComputedStyleDetailsPanel.prototype.initialLayout):
2019-08-07 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TimelineAgent already enabled
https://bugs.webkit.org/show_bug.cgi?id=200513
Reviewed by Joseph Pecoraro.
Update some incorrect compatibility comments from r248286.
* UserInterface/Protocol/InspectorFrontendAPI.js:
* UserInterface/Controllers/TimelineManager.js:
2019-08-06 Devin Rousso <drousso@apple.com>
Web Inspector: Show radius values in box model metrics view
https://bugs.webkit.org/show_bug.cgi?id=160993
<rdar://problem/27919035>
Reviewed by Brian Burg.
* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WI.BoxModelDetailsSectionRow.prototype._getPropertyValue): Added.
(WI.BoxModelDetailsSectionRow.prototype._getPropertyValueAsPx):
(WI.BoxModelDetailsSectionRow.prototype._getBox):
(WI.BoxModelDetailsSectionRow.prototype._getComponentPrefix): Added.
(WI.BoxModelDetailsSectionRow.prototype._getComponentSuffix):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createBoxPartElement):
(WI.BoxModelDetailsSectionRow.prototype._updateMetrics.createContentAreaElement):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput):
(WI.BoxModelDetailsSectionRow.prototype._applyUserInput.inspectedPage_node_toggleInlineStyleProperty):
* UserInterface/Views/BoxModelDetailsSectionRow.css:
(.details-section .row.box-model .box): Added.
(.details-section .row.box-model .box > .label): Added.
(.details-section .row.box-model .box.position): Added.
(.details-section .row.box-model .box.margin): Added.
(.details-section .row.box-model:not(.hovered) .box.margin, .details-section .row.box-model .box.margin.active): Added.
(.details-section .row.box-model .box.border): Added.
(.details-section .row.box-model:not(.hovered) .box.border, .details-section .row.box-model .box.border.active): Added.
(.details-section .row.box-model .box.border > .label): Added.
(.details-section .row.box-model .box.border.has-top-left-radius, .details-section .row.box-model .box.border.has-top-left-radius .box): Added.
(.details-section .row.box-model .box.border.has-top-right-radius, .details-section .row.box-model .box.border.has-top-right-radius .box): Added.
(.details-section .row.box-model .box.border.has-bottom-right-radius, .details-section .row.box-model .box.border.has-bottom-right-radius .box): Added.
(.details-section .row.box-model .box.border.has-bottom-left-radius, .details-section .row.box-model .box.border.has-bottom-left-radius .box): Added.
(.details-section .row.box-model .box.padding): Added.
(.details-section .row.box-model:not(.hovered) .box.padding, .details-section .row.box-model .box.padding.active): Added.
(.details-section .row.box-model .box.content): Added.
(.details-section .row.box-model:not(.hovered) .box.content, .details-section .row.box-model .box.content.active): Added.
(.details-section .row.box-model :matches(.top, .right, .bottom, .left)): Added.
(.details-section .row.box-model :matches(.top, .right, .bottom, .left):not(.editing), .details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
(.details-section .row.box-model :matches(.top-left, .top-right, .bottom-right, .bottom-left)): Added.
(.details-section .row.box-model :matches(.top-left, .top-right)): Added.
(.details-section .row.box-model :matches(.bottom-left, .bottom-right):not(.editing)): Added.
(.details-section .row.box-model :matches(.bottom-left, .bottom-right).editing): Added.
(.details-section .row.box-model :matches(.top-left, .bottom-left):not(.editing)): Added.
(.details-section .row.box-model :matches(.top-left, .bottom-left).editing): Added.
(.details-section .row.box-model :matches(.top-right, .bottom-right):not(.editing)): Added.
(.details-section .row.box-model :matches(.top-right, .bottom-right).editing): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model:not(.hovered) .box:matches(.margin, .border, .padding, .content), .details-section .row.box-model .box.active:matches(.margin, .border, .padding, .content)): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box.margin): Added.
(@media (prefers-color-scheme: dark) .details-section .row.box-model .box.border): Added.
(.details-section .row.box-model :matches(.position, .margin, .border, .padding, .content)): Deleted.
(.details-section .row.box-model .position): Deleted.
(.details-section .row.box-model .margin): Deleted.
(.details-section .row.box-model:not(.hovered) .margin, .details-section .row.box-model .margin.active): Deleted.
(.details-section .row.box-model .border): Deleted.
(.details-section .row.box-model:not(.hovered) .border, .details-section .row.box-model .border.active): Deleted.
(.details-section .row.box-model .padding): Deleted.
(.details-section .row.box-model:not(.hovered) .padding, .details-section .row.box-model .padding.active): Deleted.
(.details-section .row.box-model .content): Deleted.
(.details-section .row.box-model:not(.hovered) .content, .details-section .row.box-model .content.active): Deleted.
(.details-section .row.box-model :matches(.content span, .top, .right, .bottom, .left)): Deleted.
(.details-section .row.box-model :matches(.right, .left)): Deleted.
(.details-section .row.box-model:not(.hovered) :matches(.margin, .border, .padding, .content), .details-section .row.box-model .active:matches(.margin, .border, .padding, .content)): Deleted.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.update):
Ensure that the `_value` is updated whenever the `_rawValue` is updated.
2019-08-06 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r248289.
https://bugs.webkit.org/show_bug.cgi?id=200488
Broke internal builds (Requested by drousso on #webkit).
Reverted changeset:
"Web Inspector: Styles: show @supports CSS groupings"
https://bugs.webkit.org/show_bug.cgi?id=200419
https://trac.webkit.org/changeset/248289
2019-08-06 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: RTL: go-to arrows and expand triangles in Computed panel should match their context
https://bugs.webkit.org/show_bug.cgi?id=200449
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ComputedStyleSection.css:
(body[dir=rtl] .computed-style-section .computed-property-item .disclosure-button): Deleted.
* UserInterface/Views/Main.css:
(body[dir=rtl] [dir=ltr] .go-to-arrow): Added.
In the RTL mode, LTR "islands" should have their contents to be still LTR.
2019-08-05 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: show @supports CSS groupings
https://bugs.webkit.org/show_bug.cgi?id=200419
Reviewed by Joseph Pecoraro.
* UserInterface/Models/CSSGrouping.js: Renamed from Source/WebInspectorUI/UserInterface/Models/CSSMedia.js.
(WI.CSSGrouping):
(WI.CSSGrouping.prototype.get type):
(WI.CSSGrouping.prototype.get text):
(WI.CSSGrouping.prototype.get sourceCodeLocation):
(WI.CSSGrouping.prototype.get isMedia): Added.
(WI.CSSGrouping.prototype.get isSupports): Added.
(WI.CSSGrouping.prototype.get prefix): Added.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.get groupings): Added.
(WI.CSSStyleDeclaration.prototype.generateCSSRuleString):
(WI.CSSStyleDeclaration.prototype.get mediaList): Deleted.
* UserInterface/Models/CSSRule.js:
(WI.CSSRule):
(WI.CSSRule.prototype.get groupings): Added.
(WI.CSSRule.prototype.update):
(WI.CSSRule.prototype._selectorResolved):
(WI.CSSRule.prototype.get mediaList): Deleted.
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._parseRulePayload):
(WI.DOMNodeStyles.prototype.rulesForSelector): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._handleEditorFilterApplied):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._createMediaHeader): Deleted.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration :matches(.header, .header-groupings)): Added.
(.spreadsheet-css-declaration :matches(.header, .header-groupings):first-child): Added.
(.spreadsheet-css-declaration .header-groupings > .grouping): Added.
(.spreadsheet-css-declaration .header-groupings + .header > .selector > .icon): Added.
(.spreadsheet-css-declaration :matches(.header, .header-media)): Deleted.
(.spreadsheet-css-declaration :matches(.header, .header-media):first-child): Deleted.
(.spreadsheet-css-declaration .media-label): Deleted.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.protocolGroupingTypeToEnum): Added.
(WI.CSSManager.protocolMediaSourceToEnum): Deleted.
* UserInterface/Main.html:
* UserInterface/Test.html:
2019-08-05 Devin Rousso <drousso@apple.com>
Can't use $0, $1 etc when inspecting Google Docs pages because the content uses these for function names
https://bugs.webkit.org/show_bug.cgi?id=195834
Reviewed by Joseph Pecoraro.
Allow the user to alias saved results by providing a different prefix (e.g. "$") from within
Web Inspector. When changing the alias, all existing saved results will update to be
reference-able from the new alias.
* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager):
(WI.RuntimeManager.preferredSavedResultPrefix): Added.
(WI.RuntimeManager.prototype.initializeTarget):
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
* UserInterface/Base/Setting.js:
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.contentLoaded.updateConsoleSavedResultPrefixCSSVariable): Added.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.toClipboardString):
(WI.ConsoleMessageView.prototype.removeEventListeners): Added.
(WI.ConsoleMessageView.prototype._appendSavedResultIndex):
(WI.ConsoleMessageView.prototype._appendSavedResultIndex.updateSavedVariableText): Added.
(WI.ConsoleMessageView.prototype._rootPropertyPathForObject):
(WI.ConsoleMessageView.prototype._rootPropertyPathForObject.prefixSavedResultIndex): Added.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype._sessionStarted):
(WI.LogContentView.prototype._logCleared):
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom.show-last-selected li.last-selected > span::after):
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole):
(WI.QuickConsole.prototype.closed):
(WI.QuickConsole.prototype._updateAutomaticExecutionContextPathComponentTooltip): Added.
Listen for changes to the setting that holds the current saved result alias and update any
related UI accordingly.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createConsoleSettingsView):
* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .settings-view > .container > .editor-group > .editor input[type="text"]): Added.
* UserInterface/Views/SettingsGroup.js:
(WI.SettingsGroup.prototype.addCustomEditor): Added.
Add an input to the Settings tab that controls the saved result prefix alias. Only allow
[a-zA-Z0-9_$] as values (but [0-9] cannot be used as the start).
* UserInterface/Models/PropertyPath.js:
(WI.PropertyPath.prototype.set pathComponent): Added.
Miscellaneous getters/setters.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Test/TestHarness.js:
(TestHarness.prototype.newline): Added.
Convenience function for adding newlines to test results.
2019-08-05 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: disable related agents when the tab is closed
https://bugs.webkit.org/show_bug.cgi?id=200118
Reviewed by Joseph Pecoraro.
Rework how `enable`/`disable` is used for timeline-related agents so that events are not sent
and data isn't kept alive when the Timelines tab isn't enabled.
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.get domains): Added.
(WI.TimelineManager.prototype.activateExtraDomain): Added.
(WI.TimelineManager.prototype.initializeTarget):
(WI.TimelineManager.prototype.reset):
(WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
(WI.TimelineManager.prototype.enable): Added.
(WI.TimelineManager.prototype.disable): Added.
(WI.TimelineManager.prototype.startCapturing):
(WI.TimelineManager.prototype.stopCapturing):
(WI.TimelineManager.prototype.async processJSON):
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
(WI.TimelineManager.prototype.autoCaptureStarted):
(WI.TimelineManager.prototype.eventRecorded):
(WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
(WI.TimelineManager.prototype.pageLoadEventFired):
(WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
(WI.TimelineManager.prototype.memoryTrackingUpdated):
(WI.TimelineManager.prototype.heapTrackingStarted):
(WI.TimelineManager.prototype.heapTrackingCompleted):
(WI.TimelineManager.prototype.heapSnapshotAdded):
(WI.TimelineManager.prototype._loadNewRecording):
(WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
(WI.TimelineManager.prototype._provisionalLoadStarted):
(WI.TimelineManager.prototype._mainResourceDidChange):
(WI.TimelineManager.prototype._resourceWasAdded):
(WI.TimelineManager.prototype._garbageCollected):
(WI.TimelineManager.prototype._memoryPressure):
(WI.TimelineManager.prototype.scriptProfilerTrackingUpdated):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
(WI.TimelineManager.prototype._handleDOMNodePowerEfficientPlaybackStateChanged):
* UserInterface/Models/Instrument.js:
(WI.Instrument.startLegacyTimelineAgent):
(WI.Instrument.stopLegacyTimelineAgent):
* UserInterface/Controllers/HeapManager.js:
(WI.HeapManager): Added.
(WI.HeapManager.prototype.get domains): Added.
(WI.HeapManager.prototype.activateExtraDomain): Added.
(WI.HeapManager.prototype.initializeTarget):
(WI.HeapManager.prototype.enable): Added.
(WI.HeapManager.prototype.disable): Added.
(WI.HeapManager.prototype.snapshot): Added.
(WI.HeapManager.prototype.getPreview): Added.
(WI.HeapManager.prototype.getRemoteObject): Added.
(WI.HeapManager.prototype.garbageCollected):
* UserInterface/Controllers/MemoryManager.js:
(WI.MemoryManager): Added.
(WI.MemoryManager.prototype.get domains): Added.
(WI.MemoryManager.prototype.activateExtraDomain): Added.
(WI.MemoryManager.prototype.initializeTarget):
(WI.MemoryManager.prototype.enable): Added.
(WI.MemoryManager.prototype.disable): Added.
(WI.MemoryManager.prototype.memoryPressure):
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.prototype.closed):
* UserInterface/Models/HeapAllocationsInstrument.js:
(WI.HeapAllocationsInstrument):
(WI.HeapAllocationsInstrument.prototype._takeHeapSnapshot):
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):
(WI.HeapSnapshotInstanceDataGridNode.prototype._populatePreview):
(WI.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
Go through the `HeapManager` for `HeapAgent` commands so it can better manage state.
* UserInterface/Test/Test.js:
(WI.contentLoaded):
2019-08-05 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: brotli-compressed resources have "Compressed: No" in Resources details sidebar
https://bugs.webkit.org/show_bug.cgi?id=200452
Reviewed by Joseph Pecoraro.
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.get compressed):
Add "br" - Brotli content encoding.
2019-08-05 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: variable swatch not shown for var() with a fallback
https://bugs.webkit.org/show_bug.cgi?id=200237
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
(WI.SpreadsheetStyleProperty.prototype._replaceSpecialTokens): Added.
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):
(WI.SpreadsheetStyleProperty.prototype._addVariableTokens):
Check to see if there's a fallback value in the `var()` and tokenize it if there is. Mark
the property as invalid if the `var()` doesn't end up resolving to anything.
* UserInterface/Views/InlineSwatch.js:
(WI.InlineSwatch):
(WI.InlineSwatch.prototype.get value):
(WI.InlineSwatch.prototype._updateSwatch):
(WI.InlineSwatch.prototype._handleContextMenuEvent):
(WI.InlineSwatch.prototype._getNextValidHEXFormat.hexMatchesCurrentColor):
(WI.InlineSwatch.prototype._getNextValidHEXFormat):
Allow the `value` to be a function. In that case, use the getter `this.value` instead of the
value `this._value` directly so that the function is invoked.
This is needed for variable swatches because the fallback value could change after the
swatch has been created (e.g. another swatch in a CSS property value that just modifies the
text, rather than re-renders the entire CSS property value).
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.resolveVariableValue): Added.
Follow the variable chain until an ultimate value is reached.
* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.isColorAwareProperty):
(WI.CSSKeywordCompletions.isTimingFunctionAwareProperty): Added.
Limit `cubic-bezier` and `spring` tokens to only be shown for timing function properties.
2019-08-05 Devin Rousso <drousso@apple.com>
Web Inspector: rename "Stylesheet" to "Style Sheet" to match spec text
https://bugs.webkit.org/show_bug.cgi?id=200422
Reviewed by Joseph Pecoraro.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype._resourceAdded):
(WI.CSSManager.prototype._resourceTypeDidChange):
(WI.CSSManager.prototype._clearStyleSheetsForResource):
(WI.CSSManager.prototype._updateResourceContent.fetchedStyleSheetContent):
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.get displayName):
* UserInterface/Models/CollectionTypes.js:
(WI.CSSStyleSheetCollection.prototype.get displayName):
* UserInterface/Models/Resource.js:
(WI.Resource.displayNameForType):
(WI.Resource.prototype.get syntheticMIMEType):
* UserInterface/Models/ResourceCollection.js:
(WI.ResourceCollection.prototype.objectIsRequiredType):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.shortDisplayNameForResourceType):
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype._contentViewForResourceType):
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters.match):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._save):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu):
* UserInterface/Views/StyleOriginView.js:
(WI.StyleOriginView.prototype.update):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._shouldBeEditable):
* UserInterface/Views/CSSStyleSheetTreeElement.js:
(WI.CSSStyleSheetTreeElement):
* UserInterface/Views/ResourceIcons.css:
(:matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Added.
(.source-map-resource.resource-icon.resource-type-style-sheet .icon): Added.
(.large :matches(.resource-icon.resource-type-style-sheet, .style-sheet-icon) .icon): Added.
(.large .source-map-resource.resource-icon.resource-type-style-sheet .icon): Added.
(:matches(.resource-icon.resource-type-stylesheet, .stylesheet-icon) .icon): Deleted.
(.source-map-resource.resource-icon.resource-type-stylesheet .icon): Deleted.
(.large :matches(.resource-icon.resource-type-stylesheet, .stylesheet-icon) .icon): Deleted.
(.large .source-map-resource.resource-icon.resource-type-stylesheet .icon): Deleted.
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: move psuedo-selector rules before inherited rules
https://bugs.webkit.org/show_bug.cgi?id=199950
Reviewed by Joseph Pecoraro.
Since pseudo-selector rules (usually) affect the selected element, or are related to its
content, it's more useful to have them near that element's rules instead of after all of
it's inherited rules.
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: Styles: add icons for various CSS rule types
https://bugs.webkit.org/show_bug.cgi?id=199946
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.displayNameForPseudoId):
Add hardcoded pseudo-selector identifiers for older backends.
* UserInterface/Models/CSSSelector.js:
(WI.CSSSelector.prototype.isPseudoSelector): Added.
(WI.CSSSelector.prototype.isPseudoElementSelector): Deleted.
There are more types of pseudo-selectors than just `:{before|after}`.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.generateCSSRuleString): Added.
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.spreadsheetCSSStyleDeclarationSectionAddNewRule): Added.
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
Provide a delegate method for adding a new rule, so the `WI.SpreadsheetRulesStyleDetailsPanel`
can know what selector to focus once the new rule gets added.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._populateIconElementContextMenu): Added.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration .header.editing-selector .selector): Added.
(.spreadsheet-css-declaration .selector > .icon): Added.
(.spreadsheet-css-declaration .selector > .icon + *): Added.
(.spreadsheet-css-declaration .selector.style-attribute > span): Added.
When "mousedown" (or "contextmenu") on the icon, show a context menu with helpful actions:
- Copy Rule
- {Disable|Enable} Rule
- Duplicate Selector
- Add :{active|focus|hover|visited} Rule
- Create ::{before|after} Rule
- Reveal in {Resources Tab|Sources Tab|Stylesheet}
Drive-by: add an extra 0.5px of initial margin before the Style Attribute selector (which is
sans-serif) so it properly aligns with the other selectors (which are monospaced).
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.layout):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor:empty): Added.
(.spreadsheet-style-declaration-editor.no-properties): Deleted.
Add some extra space when there's no inline style so it looks a bit less cramped.
* UserInterface/Main.html:
* UserInterface/Views/StyleRuleIcons.css: Added.
(.author-style-rule-icon .icon):
(.author-style-rule-icon.pseudo-selector .icon):
(.user-style-rule-icon .icon):
(.user-style-rule-icon.pseudo-selector .icon):
(.user-agent-style-rule-icon .icon):
(.user-agent-style-rule-icon.pseudo-selector .icon):
(.inspector-style-rule-icon .icon):
(.inspector-style-rule-icon.pseudo-selector .icon):
(.inherited-style-rule-icon .icon):
(.inherited-element-style-rule-icon .icon):
* UserInterface/Images/StyleRule.svg: Added.
* UserInterface/Images/StyleRuleInheritedElement.svg: Added.
* UserInterface/Images/StyleRulePseudo.svg: Added.
Add generic icon classes for style rule icons.
* UserInterface/Base/Setting.js:
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createExperimentalSettingsView):
Add experimental setting.
* Localizations/en.lproj/localizedStrings.js:
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: DOM: add a special breakpoint for "All Events"
https://bugs.webkit.org/show_bug.cgi?id=200285
Reviewed by Joseph Pecoraro.
Similar to the existing "All Requests" breakpoint, there should be a way to set a breakpoint
that would pause for any DOM event, regardless of the event's name. This is useful for
situations where the event name isn't known, or where one simply want's to pause on the next
entry to the event loop.
Along these lines, make the "requestAnimationFrame", "setTimeout", and "setInterval"
event breakpoints into special breakpoints that can be added/removed via the create
breakpoint context menu. This simplifies the process for setting these breakpoints, and also
makes them more discoverable (most people wouldn't consider them to be "events").
* UserInterface/Models/EventBreakpoint.js:
(WI.EventBreakpoint):
(WI.EventBreakpoint.deserialize):
(WI.EventBreakpoint.prototype.saveIdentityToCookie):
(WI.EventBreakpoint.prototype.toJSON):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype._pauseReasonFromPayload):
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager):
(WI.DOMDebuggerManager.prototype.initializeTarget):
(WI.DOMDebuggerManager.supportsDOMBreakpoints): Added.
(WI.DOMDebuggerManager.supportsEventBreakpoints):
(WI.DOMDebuggerManager.supportsEventListenerBreakpoints): Added.
(WI.DOMDebuggerManager.supportsURLBreakpoints):
(WI.DOMDebuggerManager.supportsXHRBreakpoints): Added.
(WI.DOMDebuggerManager.supportsAllListenersBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get allAnimationFramesBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get allIntervalsBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get allListenersBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get allTimeoutsBreakpoint): Added.
(WI.DOMDebuggerManager.prototype.get listenerBreakpoints): Added.
(WI.DOMDebuggerManager.prototype.isBreakpointSpecial):
(WI.DOMDebuggerManager.prototype.listenerBreakpointForEventName): Added.
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
(WI.DOMDebuggerManager.prototype.addURLBreakpoint):
(WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
(WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
(WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype.get eventBreakpoints): Deleted.
(WI.DOMDebuggerManager.prototype.eventBreakpointForTypeAndEventName): Deleted.
Add additional target compatibility checks.
* UserInterface/Views/EventBreakpointPopover.js:
(WI.EventBreakpointPopover.prototype.show):
(WI.EventBreakpointPopover.prototype.dismiss):
(WI.EventBreakpointPopover.prototype._handleTypeSelectChange): Deleted.
* UserInterface/Views/EventBreakpointPopover.css:
(.popover .event-breakpoint-content > input): Added.
(.popover .event-breakpoint-content > input::placeholder): Added.
(.popover .event-breakpoint-content > .event-type): Deleted.
(.popover .event-breakpoint-content > .event-type > input): Deleted.
(.popover .event-breakpoint-content > .event-type > input::placeholder): Deleted.
* UserInterface/Views/EventBreakpointTreeElement.css:
(.breakpoint.event.breakpoint-for-interval:not(.breakpoint-paused-icon) .icon): Added.
(.breakpoint.event.breakpoint-for-timeout:not(.breakpoint-paused-icon) .icon): Added.
(.breakpoint.event.breakpoint-for-timer:not(.breakpoint-paused-icon) .icon): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
(WI.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WI.DebuggerSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu.addToggleForSpecialEventBreakpoint): Added.
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._updatePauseReasonSection):
(WI.SourcesNavigationSidebarPanel.prototype._handleBreakpointElementAddedOrRemoved):
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu.addToggleForSpecialEventBreakpoint): Added.
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu):
Add create breakpoint context menu items (also sort the breakpoints in this order):
- "All Animation Frames" => [A] All Animation Frames
- "All Timeouts" => [T] All Timeouts
- "All Intervals" => [I] All Intervals
- "All Events" => [E] All Events
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
(WI.JavaScriptRuntimeCompletionProvider.completionControllerCompletionsNeeded.receivedPropertyNames):
* UserInterface/Base/Setting.js:
* UserInterface/Images/EventBreakpointInterval.svg: Added.
* UserInterface/Images/EventBreakpointTimeout.svg: Renamed from Source/WebInspectorUI/UserInterface/Images/EventBreakpointTimer.svg.
* Localizations/en.lproj/localizedStrings.js:
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: Heap Snapshot Views should be searchable
https://bugs.webkit.org/show_bug.cgi?id=157582
<rdar://problem/26228629>
Reviewed by Joseph Pecoraro.
Without the ability to filter/search, it's far more difficult to find objects of interest.
Rather than spending time scrolling through the entire heap snapshot or sorting by "Name",
a simple filter/search (which also uses the global search settings) is almost instant.
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype.updateFilter): Addded.
(WI.HeapAllocationsTimelineView.prototype.get showsFilterBar): Deleted.
* UserInterface/Views/HeapSnapshotClusterContentView.js:
(WI.HeapSnapshotClusterContentView.prototype.updateFilter): Added.
* UserInterface/Views/HeapSnapshotContentView.js:
(WI.HeapSnapshotContentView):
(WI.HeapSnapshotContentView.prototype.updateFilter): Added.
(WI.HeapSnapshotContentView.prototype.dataGridMatchNodeAgainstCustomFilters): Added.
(WI.HeapSnapshotContentView.prototype.dataGridMatchShouldPopulateWhenFilteringNode): Added.
* UserInterface/Views/DataGrid.js:
(WI.DataGrid.prototype._updateFilter.createIteratorForNodesToBeFiltered):
Don't attempt to populate each heap snapshot `WI.DataGridNode` when filtering, as that can
quickly exhaust memory due to the sheer size of a heap snapshot.
* UserInterface/Base/Main.js:
(WI._find):
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView.prototype.get canHandleFindEvent): Added.
(WI.TimelineTabContentView.prototype.handleFindEvent): Added.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype.get canFocusFilterBar): Added.
(WI.TimelineRecordingContentView.prototype.focusFilterBar): Added.
* UserInterface/Views/FilterBar.js:
(WI.FilterBar.prototype.focus): Added.
Allow the current tab to intercept the find shortcut and do something custom. In the case
of a `WI.TimelineTabContentView`, declare that it can handle the find event if the displayed
content view (`WI.TimelineRecordingContentView`) can focus it's filter bar. If so, when the
find shortcut is triggered, focus the filter bar.
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: CSS Formatter: comments with an escape character aren't formatted
https://bugs.webkit.org/show_bug.cgi?id=200168
Reviewed by Joseph Pecoraro.
Don't allow escaping of the "*" in CSS comments (e.g. `\*/`).
Add additional pretty printing rules for comments so that there's always some space between
them and the surrounding text. This ensures that they don't interfere with readability.
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter.prototype._format):
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.get indented): Added.
2019-08-03 Devin Rousso <drousso@apple.com>
Web Inspector: Console: execution context picker doesn't update when switching to the inferred context from auto
https://bugs.webkit.org/show_bug.cgi?id=200279
Reviewed by Joseph Pecoraro.
The `representedObject` of the "auto" execution context path component is shared with that
execution context's actual path component, meaning that if the user switches from "auto" to
that execution context's path component, the underlying `representedObject` wouldn't change,
and therfore the `RuntimeManager.Event.ActiveExecutionContextChanged` wouldn't fire. In this
case, update the visible ("selected") execution context path component manually.
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._selectExecutionContext):
(WI.QuickConsole.prototype._pathComponentSelected):
2019-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: Console: all navigation items should be shown in the split console
https://bugs.webkit.org/show_bug.cgi?id=200280
Reviewed by Joseph Pecoraro.
* UserInterface/Views/LogContentView.js:
(WI.LogContentView):
(WI.LogContentView.prototype.get navigationItems):
Adjust the `visibilityPriority` of each `navigationItems` so that the filter/scope bars are
kept visible for longer than the "Preserve Log"/"Emulate User Gesture" toggles.
* UserInterface/Views/FindBanner.js:
(WI.FindBanner):
* UserInterface/Views/FindBanner.css:
(.find-banner.console-find-banner > input[type="search"]):
(.find-banner.console-find-banner > :matches(input[type="search"], button)):
(.find-banner.console-find-banner > input[type="search"]:focus, .find-banner.console-find-banner > input[type="search"]:focus ~ button, .find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown), .find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown) ~ button ): Added.
(.find-banner.console-find-banner > input[type="search"]::placeholder): Deleted.
(.find-banner.console-find-banner > input[type="search"]:focus): Deleted.
(.find-banner.console-find-banner > input[type="search"]:not(:placeholder-shown)): Deleted.
(@media (prefers-color-scheme: dark) .find-banner.console-find-banner > input[type=search]:not(:placeholder-shown)): Deleted.
Make the `WI.FindBanner` blend in with the surrounding content when it's not focused or has
no content.
2019-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: Storage: disable related agents when the tab is closed
https://bugs.webkit.org/show_bug.cgi?id=200117
Reviewed by Joseph Pecoraro.
Rework how `enable`/`disable` is used for storage-related agents so that events are not sent
and data isn't kept alive when the Storage tab isn't enabled.
* UserInterface/Controllers/ApplicationCacheManager.js:
(WI.ApplicationCacheManager):
(WI.ApplicationCacheManage.prototype.get domains): Added.
(WI.ApplicationCacheManage.prototype.activateExtraDomain): Added.
(WI.ApplicationCacheManager.prototype.initializeTarget):
(WI.ApplicationCacheManager.prototype.enable): Added.
(WI.ApplicationCacheManager.prototype.disable): Added.
(WI.ApplicationCacheManager.prototype.networkStateUpdated):
(WI.ApplicationCacheManager.prototype.applicationCacheStatusUpdated):
(WI.ApplicationCacheManager.prototype._reset): Added.
(WI.ApplicationCacheManager.prototype._mainResourceDidChange):
(WI.ApplicationCacheManager.prototype._manifestForFrameLoaded):
(WI.ApplicationCacheManager.prototype._framesWithManifestsLoaded):
(WI.ApplicationCacheManager.prototype.initialize): Deleted.
* UserInterface/Controllers/DOMStorageManager.js:
(WI.DOMStorageManager):
(WI.DOMStorageManager.prototype.get domains): Added.
(WI.DOMStorageManager.prototype.activateExtraDomain): Added.
(WI.DOMStorageManager.prototype.initializeTarget):
(WI.DOMStorageManager.prototype.enable): Added.
(WI.DOMStorageManager.prototype.disable): Added.
(WI.DOMStorageManager.prototype.itemsCleared):
(WI.DOMStorageManager.prototype.itemRemoved):
(WI.DOMStorageManager.prototype.itemAdded):
(WI.DOMStorageManager.prototype.itemUpdated):
(WI.DOMStorageManager.prototype.inspectDOMStorage):
(WI.DOMStorageManager.prototype._reset): Added.
(WI.DOMStorageManager.prototype._addDOMStorageIfNeeded):
(WI.DOMStorageManager.prototype._addCookieStorageIfNeeded):
(WI.DOMStorageManager.prototype._mainResourceDidChange):
(WI.DOMStorageManager.prototype.initialize): Deleted.
(WI.DOMStorageManager.prototype.domStorageWasAdded): Deleted.
* UserInterface/Controllers/DatabaseManager.js:
(WI.DatabaseManager):
(WI.DatabaseManager.prototype.get domains): Added.
(WI.DatabaseManager.prototype.activateExtraDomain): Added.
(WI.DatabaseManager.prototype.initializeTarget):
(WI.DatabaseManager.prototype.enable): Added.
(WI.DatabaseManager.prototype.disable): Added.
(WI.DatabaseManager.prototype.databaseWasAdded):
(WI.DatabaseManager.prototype.inspectDatabase):
(WI.DatabaseManager.prototype._reset): Added.
(WI.DatabaseManager.prototype._mainResourceDidChange):
(WI.DatabaseManager.prototype.initialize): Deleted.
* UserInterface/Controllers/IndexedDBManager.js:
(WI.IndexedDBManager):
(WI.IndexedDBManager.prototype.get domains): Added.
(WI.IndexedDBManager.prototype.activateExtraDomain): Added.
(WI.IndexedDBManager.prototype.initializeTarget):
(WI.IndexedDBManager.prototype.enable): Added.
(WI.IndexedDBManager.prototype.disable): Added.
(WI.IndexedDBManager.prototype.clearObjectStore):
(WI.IndexedDBManager.prototype._reset): Added.
(WI.IndexedDBManager.prototype._mainResourceDidChange):
(WI.IndexedDBManager.prototype.initialize): Deleted.
* UserInterface/Controllers/AppController.js:
(WI.AppController.prototype.activateExtraDomains):
* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.get domains): Added.
(WI.CanvasManager.prototype.activateExtraDomain): Added.
Only call `enable` on any extra agents if the domain is not controlled by a manager.
* UserInterface/Views/StorageTabContentView.js:
(WI.StorageTabContentView):
(WI.StorageTabContentView.static isTabAllowed):
(WI.StorageTabContentView.prototype.canShowRepresentedObject):
(WI.StorageTabContentView.prototype.closed): Added.
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WI.loaded):
(WI.contentLoaded):
2019-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: Develop > Start Timeline Recording doesn't work when focused on a detached inspector window
https://bugs.webkit.org/show_bug.cgi?id=200125
<rdar://problem/53543008>
Reviewed by Brian Burg.
Always show the Timelines tab in Web Inspector whenever timeline recording starts/stops.
Notify the UIProcess whenever the timeline recording state changes.
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.setTimelineProfilingEnabled):
2019-08-02 Devin Rousso <drousso@apple.com>
Web Inspector: "Inspector.initialized" happens before breakpoints are set
https://bugs.webkit.org/show_bug.cgi?id=200364
Reviewed by Joseph Pecoraro.
Allow managers to register a promise that will delay `Inspector.initialized`. This is needed
when restoring breakpoints so that "Automatically Show Web Inspector for JSContexts" can set
them before any scripts have evaluated, ensuring that no breakpoints are "skipped".
* UserInterface/Protocol/Target.js:
(WI.Target.prototype.initialize):
(WI.Target.registerInitializationPromise): Added.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager):
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
2019-08-01 Devin Rousso <drousso@apple.com>
Unreviewed, remove `emulateUserGesture` parameter from `Debugger.evaluateOnCallFrame` for iOS 13
Rubber-stamped by Joseph Pecoraro.
* UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js:
* Versions/Inspector-iOS-13.0.json:
The iOS 13 protocol has already been decided, so these shouldn't have been added unless they
were cherry-picked in.
2019-07-31 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: support emulateUserGesture parameter in Debugger.evaluateOnCallFrame
https://bugs.webkit.org/show_bug.cgi?id=200272
Reviewed by Joseph Pecoraro.
When paused, evaluating in the console should still respect the "Emulate User Gesture" checkbox.
* UserInterface/Controllers/RuntimeManager.js:
(WI.RuntimeManager.prototype.evaluateInInspectedWindow):
* UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js:
* Versions/Inspector-iOS-13.0.json:
2019-07-31 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'issueMessage.sourceCodeLocation.sourceCode')
https://bugs.webkit.org/show_bug.cgi?id=200296
Reviewed by Joseph Pecoraro.
When fetching all `WI.IssueMessage`s for a given `WI.SourceCode`, the `WI.IssueMessage` may
be associated in a different way (e.g. by url, instead of `WI.SourceCodeLocation`). As such,
we should pass the `WI.SourceCode` along, and use it when adding the `WI.IssueTreeElement`.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._addIssuesForSourceCode):
(WI.DebuggerSidebarPanel.prototype._addIssue):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._addIssue):
(WI.SourcesNavigationSidebarPanel.prototype._addIssuesForSourceCode):
2019-07-31 Devin Rousso <drousso@apple.com>
Web Inspector: DOM: provide a way to disable/breakpoint all event listeners for a given DOM node or event type
https://bugs.webkit.org/show_bug.cgi?id=200233
Reviewed by Joseph Pecoraro.
Often, when trying to debug issues with DOM events, it's extremely tedious to have to go
through event listeners one by one and disable them (or set a breakpoint). This patch adds
a way of performing these "state modifications" in batch operations, based on the current
grouping method of the Event Listeners section.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.supportsDisablingEventListeners): Added.
(WI.DOMManager.supportsEventListenerBreakpoints): Added.
Common convenience functions for checking for protocol support.
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.createEventListenerSection):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.css:
(.sidebar > .panel.dom-node-details .details-section.dom-node-event-listeners .details-section.event-listener-section > .header > .event-listener-options): Added.
(.sidebar > .panel.dom-node-details .details-section.dom-node-event-listeners .details-section.event-listener-section:hover > .header > .event-listener-options): Added.
Add an options element that shows a context menu:
- "Disable Event Listeners"/"Enable Event Listeners"
- "Add Breakpoints"/"Delete Breakpoints"
Each action applies the corresponding state to all event listeners in that section.
* UserInterface/Views/EventListenerSectionGroup.js:
(WI.EventListenerSectionGroup):
(WI.EventListenerSectionGroup.prototype.get supportsStateModification): Added.
(WI.EventListenerSectionGroup.prototype.get isEventListenerDisabled): Added.
(WI.EventListenerSectionGroup.prototype.set isEventListenerDisabled): Added.
(WI.EventListenerSectionGroup.prototype.get hasEventListenerBreakpoint): Added.
(WI.EventListenerSectionGroup.prototype.set hasEventListenerBreakpoint): Added.
(WI.EventListenerSectionGroup.prototype._updateDisabledToggle): Added.
(WI.EventListenerSectionGroup.prototype._updateBreakpointToggle): Added.
(WI.EventListenerSectionGroup.prototype._createDisabledToggleRow): Deleted.
(WI.EventListenerSectionGroup.prototype._createBreakpointToggleRow): Deleted.
Expose a way to modify the event listener's state so that the UI (e.g. checkbox and title)
also get's updated.
* Localizations/en.lproj/localizedStrings.js:
2019-07-30 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Resources: Display outline around images when viewing image collections
https://bugs.webkit.org/show_bug.cgi?id=200212
Reviewed by Devin Rousso.
* UserInterface/Views/CollectionContentView.css:
(.content-view.collection .resource.image img):
(.content-view.collection .resource.image img:hover):
2019-07-29 Devin Rousso <drousso@apple.com>
Web Inspector: Resources: add a "Show Grid" navigation item for the Images collection
https://bugs.webkit.org/show_bug.cgi?id=200260
Reviewed by Joseph Pecoraro.
Each subview `WI.ImageResourceContentView` already listens for changes to the underlying
`WI.settings.showImageGrid` and adds the `.show-grid` class if enabled. As such, this change
just adds a `WI.ButtonNavigationItem` for toggling `WI.settings.showImageGrid` from the
Images "folder".
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView):
(WI.ResourceCollectionContentView.prototype.get navigationItems):
(WI.ResourceCollectionContentView.prototype.attached): Added.
(WI.ResourceCollectionContentView.prototype.detached): Added.
(WI.ResourceCollectionContentView.prototype._updateImageTypeScopeBar):
Drive-by: hide the image type `WI.ScopeBar` if there's only one type of image.
(WI.ResourceCollectionContentView.prototype._handleShowGridButtonClicked): Added.
(WI.ResourceCollectionContentView.prototype._handleShowImageGridSettingChanged): Added.
2019-07-29 Devin Rousso <drousso@apple.com>
Web Inspector: add -webkit-* keywords for *-height CSS properties
https://bugs.webkit.org/show_bug.cgi?id=200240
Reviewed by Joseph Pecoraro.
* UserInterface/Models/CSSKeywordCompletions.js:
* UserInterface/Views/Main.css:
(.message-text-view):
* UserInterface/Views/Toolbar.css:
(.toolbar .control-section):
(.toolbar .item-section):
Replace `-webkit-min-content` with `min-content`.
2019-07-26 Greg Doolittle <gr3g@apple.com>
Web Inspector: AXI: Audit: Typo of "some" as "somee"
https://bugs.webkit.org/show_bug.cgi?id=200166
Reviewed by Devin Rousso.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype._addDefaultTests):
(WI.AuditManager):
2019-07-24 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: no context menu items work when context menu clicking on "Add Breakpoint"
https://bugs.webkit.org/show_bug.cgi?id=199953
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ContextMenuUtilities.js:
(WI.addMouseDownContextMenuHandlers): Added.
Create a helper function for managing elements that show a context menu on "mousedown".
* UserInterface/Base/SearchUtilities.js:
(WI.SearchUtilities.createSettingsButton):
* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype.initialLayout):
(WI.CanvasContentView.prototype._populateCanvasElementButtonContextMenu): Added.
(WI.CanvasContentView.prototype._populateViewShaderButtonContextMenu): Added.
(WI.CanvasContentView.prototype._populateViewRecordingButtonContextMenu): Added.
(WI.CanvasContentView.prototype._handleCanvasElementButtonMouseDown): Deleted.
(WI.CanvasContentView.prototype._handleViewShaderButtonMouseDown): Deleted.
(WI.CanvasContentView.prototype._handleViewRecordingButtonMouseDown): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype._populateCreateBreakpointContextMenu): Added.
(WI.DebuggerSidebarPanel.prototype._handleCreateBreakpointMouseDown): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._populateResourceGroupingModeContextMenu): Added.
(WI.SourcesNavigationSidebarPanel.prototype._populateCreateBreakpointContextMenu): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleResourceGroupingModeMouseDown): Deleted.
(WI.SourcesNavigationSidebarPanel.prototype._handleCreateBreakpointMouseDown): Deleted.
* UserInterface/Views/TabBar.js:
(WI.TabBar):
(WI.TabBar.prototype._handleTabPickerTabContextMenu): Deleted.
* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar):
(WI.LegacyTabBar.prototype._handleTabPickerTabContextMenu): Deleted.
Remove the "contextmenu" handler on the tab picker, as that's already used by the entire
tab bar to show/hide tabs.
2019-07-24 Devin Rousso <drousso@apple.com>
Web Inspector: print the target of `console.screenshot` last so the target is the closest item to the image
https://bugs.webkit.org/show_bug.cgi?id=199308
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype.render):
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
(WI.ConsoleMessageView.prototype._handleContextMenu):
* UserInterface/Views/ConsoleMessageView.css:
(.console-image > .console-message-body > :matches(hr, img)): Added.
(.console-image > .console-message-body > hr): Added.
(.console-image > .console-message-body > img): Added.
(.console-log-level.console-image::before): Added.
(.console-message-body > .console-image): Deleted.
(.console-log-level.console-image-container::before): Deleted.
Allow `ConsoleMessage.MessageType.Image` to be an `ConsoleMessage.MessageLevel.Error`, and
print the message (and extra parameters) in that case.
Drive-by: reorganize the switch-case so all paths have the same `default` case.
* Localizations/en.lproj/localizedStrings.js:
2019-07-23 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: Command-X should cut selected properties
https://bugs.webkit.org/show_bug.cgi?id=199341
Reviewed by Devin Rousso.
Implement cutting of selected CSS properties in the style editor.
Unify cutting and copying logic wherever possible.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.placeTextCaretInFocusedProperty): Added.
Cut/copy events could only fire on SpreadsheetCSSStyleDeclarationEditor element if it
has selection inside of it. Placing text caret at the beginning of the focused property
ensures that.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyCopy): Deleted.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._handleKeyDown):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._copySelectedProperties): Added.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._removeSelectedProperties): Added.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._stopSelection):
* UserInterface/Views/SpreadsheetStyleProperty.js:
Remove old copying logic.
2019-07-23 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Display "Resource has no content" for about:blank iframes instead of an error
https://bugs.webkit.org/show_bug.cgi?id=198029
Reviewed by Devin Rousso.
Display "about:blank" in the middle of the content view when selecting "about:blank" resources.
Previoulsly, we showed a misleading "An error occurred trying to load the resource" error
message.
* UserInterface/Models/CSSStyleSheet.js:
(WI.CSSStyleSheet.prototype.requestContentFromBackend):
* UserInterface/Models/Resource.js:
(WI.Resource.prototype.requestContentFromBackend):
* UserInterface/Models/Script.js:
(WI.Script.prototype.requestContentFromBackend):
* UserInterface/Models/SourceCode.js:
(WI.SourceCode.generateSpecialContentForURL):
(WI.SourceCode.prototype._processContent):
(WI.SourceCode):
* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype._contentAvailable):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype._contentAvailable):
(WI.SourceCodeTextEditor.prototype._showMessage):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._contentDidPopulate):
Display empty text editor when it has no content instead of "Resource has no content" message.
2019-07-22 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: Breakpoint at specified location already exists.
https://bugs.webkit.org/show_bug.cgi?id=197034
<rdar://problem/50049004>
Reviewed by Joseph Pecoraro.
When "adjusting" a `WI.Breakpoint` (e.g. removing and then re-adding with a different
configuration), make sure to only re-add the `WI.Breakpoint` to the `WI.Target` it was just
removed from, rather to all `WI.targets`.
Since we iterate over `WI.targets` in both `WI.DebuggerManager.prototype._setBreakpoint` and
`WI.DebuggerManager.prototype._removeBreakpoint`, we ended up iterating `WI.targets` twice.
Each time the `WI.Breakpoint` is removed from a `WI.Target`, pass the `WI.Target` to the
`callback` given to `WI.DebuggerManager.prototype._removeBreakpoint`, so that the eventual
call to `WI.DebuggerManager.prototype._setBreakpoint` can reuse it as the `specificTarget`,
instead of iterating `WI.targets` (meaning we only iterate it once).
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.addBreakpoint):
(WI.DebuggerManager.prototype._removeBreakpoint.didRemoveBreakpoint):
(WI.DebuggerManager.prototype._breakpointDisplayLocationDidChange):
(WI.DebuggerManager.prototype._breakpointEditablePropertyDidChange):
2019-07-22 Devin Rousso <drousso@apple.com>
Localization: change fps to FPS
<rdar://problem/53342508>
Rubber-stamped by Joseph Pecoraro.
* UserInterface/Views/RenderingFrameTimelineOverviewGraph.js:
(WI.RenderingFrameTimelineOverviewGraph.prototype._updateDividers.createDividerAtPosition):
* Localizations/en.lproj/localizedStrings.js:
2019-07-19 Devin Rousso <drousso@apple.com>
Web Inspector: Issues toggling multiple breakpoints on one line
https://bugs.webkit.org/show_bug.cgi?id=199918
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor):
(WI.SourceCodeTextEditor.prototype.close):
(WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu):
(WI.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting):
(WI.SourceCodeTextEditor.prototype._handleFormatterDidChange): Added.
Listen for `WI.SourceCode.Event.FormatterDidChange` events as there may be multiple content
views for the same `WI.SourceCode`. Previously, if there were, only the active one would
properly update it's "line -> column -> breakpoint" mapping, causing an error to be thrown
when the non-active content views tried to retrieve the breakpoint for the new line/column.
2019-07-17 Olivier Blin <olivier.blin@softathome.com>
Web Inspector: application/xml content not shown
https://bugs.webkit.org/show_bug.cgi?id=199861
Reviewed by Devin Rousso.
application/xml content from XHR requests was not shown in the
inspector, an error message was displayed instead.
application/xml content should be treated as text, since
application/xml is the standard mimetype for XML content.
Apache serves XML content with the application/xml mimetype by
default.
* UserInterface/Base/MIMETypeUtilities.js:
(WI.fileExtensionForMIMEType):
Report "xml" extension for "application/xml" mimetype.
(WI.shouldTreatMIMETypeAsText):
Treat XML files as text.
2019-07-16 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Changes panel should be strictly LTR
https://bugs.webkit.org/show_bug.cgi?id=199767
Reviewed by Joseph Pecoraro.
Changes panel is primarily CSS code and CSS is strictly LTR.
* UserInterface/Views/ChangesDetailsSidebarPanel.js:
(WI.ChangesDetailsSidebarPanel):
2019-07-15 Youenn Fablet <youenn@apple.com>
Enable a debug WebRTC mode without any encryption
https://bugs.webkit.org/show_bug.cgi?id=199177
<rdar://problem/52074986>
Reviewed by Eric Carlson.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
2019-07-15 Greg Doolittle <gr3g@apple.com>
Web Inspector: AXI: Audit: Typos in Accessibility audits
https://bugs.webkit.org/show_bug.cgi?id=199716
<rdar://problem/52721711>
Reviewed by Devin Rousso.
* UserInterface/Controllers/AuditManager.js:
2019-07-15 Devin Rousso <drousso@apple.com>
Web Inspector: Device Settings: update Safari user agent from 12.2 to 13.0
https://bugs.webkit.org/show_bug.cgi?id=199758
Reviewed by Maciej Stachowiak.
* UserInterface/Base/Main.js:
(WI._handleDeviceSettingsToolbarButtonClicked):
2019-07-12 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Changes: dismissing a blank property makes style rule to show in Changes panel
https://bugs.webkit.org/show_bug.cgi?id=199760
Reviewed by Devin Rousso.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateOwnerStyleText):
Call updatePropertiesModifiedState even when _updateOwnerStyleText returns early.
2019-07-12 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: always show all navigation bar items, but disable those that wouldn't work
https://bugs.webkit.org/show_bug.cgi?id=199594
Reviewed by Ross Kirsling.
Reorder the navigation items of the Elements tab (left to right):
- Show rulers
- Force print media styles
- Force Dark Appearance / Force Light Appearance
- Show compositing borders
- Enable paint flashing
- Show shadow DOM nodes
This way, "related" (e.g. print styles and dark/light appearance both relate to CSS media)
toggles are grouped closer together.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._defaultAppearanceDidChange):
(WI.DOMTreeContentView.prototype._toggleAppearance):
* Localizations/en.lproj/localizedStrings.js:
2019-07-11 Devin Rousso <drousso@apple.com>
Web Inspector: Layers: Uncaught Exception: Request with id = 2 failed. {"code":-32601,"message":"'Page' domain was not found","data":[{"code":-32601,"message":"'Page' domain was not found"}]}
https://bugs.webkit.org/show_bug.cgi?id=199555
Reviewed by Joseph Pecoraro.
Use modern inspected target support checking, and defer agent commands until a target is
available.
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype._showPaintRectsSettingChanged):
(WI.Layers3DContentView.prototype._updateCompositingBordersButtonState):
(WI.Layers3DContentView.prototype._toggleCompositingBorders):
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype._toggleCompositingBorders):
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
(WI.DOMTreeContentView.prototype._showPaintRectsSettingChanged):
(WI.DOMTreeContentView.prototype._showPrintStylesChanged):
(WI.DOMTreeContentView.prototype._showRulersChanged):
Drive-by: apply the same changes to the Elements tab for when the Layers tab isn't enabled.
2019-07-09 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: replace WTF::Vector with std::initializer_list in CallTracer to avoid dynamic allocations
https://bugs.webkit.org/show_bug.cgi?id=199611
Reviewed by Joseph Pecoraro.
* UserInterface/Models/Recording.js:
(WI.Recording.prototype.async swizzle):
Drive-by: handle the situation where a parameter is an array of deduplicated strings, which
would otherwise be treated as an array of numbers.
2019-07-09 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Add another Protocol Version (iOS 13.0)
https://bugs.webkit.org/show_bug.cgi?id=199631
<rdar://problem/47538193>
Reviewed by Devin Rousso.
* UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js: Added.
* Versions/Inspector-iOS-13.0.json: Added.
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: special breakpoints and event targets should be sorted into separate "areas"
https://bugs.webkit.org/show_bug.cgi?id=199554
Reviewed by Joseph Pecoraro.
Move the special All Requests breakpoint down to be right above all other URL breakpoints.
Move the `window` object tree element below other DOM node tree elements.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._addTreeElement):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._insertDebuggerTreeElement):
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: DOM Debugger: there should be different icons for each type of DOM breakpoint
https://bugs.webkit.org/show_bug.cgi?id=199552
Reviewed by Joseph Pecoraro.
[S] for Subtree Modified
[A] for Attribute Modified
[R] for Node Removed
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement):
* UserInterface/Views/DOMBreakpointTreeElement.css: Added.
(.breakpoint.dom.breakpoint-for-subtree-modified:not(.breakpoint-paused-icon) .icon):
(.breakpoint.dom.breakpoint-for-attribute-modified:not(.breakpoint-paused-icon) .icon):
(.breakpoint.dom.breakpoint-for-node-removed:not(.breakpoint-paused-icon) .icon):
* UserInterface/Main.html:
* UserInterface/Images/DOMBreakpointAttributeModified.svg: Added.
* UserInterface/Images/DOMBreakpointNodeRemoved.svg: Added.
* UserInterface/Images/DOMBreakpointSubtreeModified.svg: Added.
2019-07-08 Devin Rousso <drousso@apple.com>
Uncaught Exception: Unexpected enum value: CPU
https://bugs.webkit.org/show_bug.cgi?id=199564
Reviewed by Joseph Pecoraro.
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype._updateAutoCaptureInstruments):
Filter the list of auto-capture instruments based on what's actually supported, instead of
directly using the saved list from the `WI.Setting`.
2019-07-08 Devin Rousso <drousso@apple.com>
Enabling the Layers tab hides the paint flashing button
https://bugs.webkit.org/show_bug.cgi?id=199549
Reviewed by Joseph Pecoraro.
Still show the Compositing Borders and Paint Flashing navigation items in the Elements tab
even when the Layers tab is enabled (just like the Layers details sidebar).
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._updateCompositingBordersButtonToMatchPageSettings):
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Elements: pasting in the Styles sidebar adds a text node to the DOM tree
https://bugs.webkit.org/show_bug.cgi?id=199588
Reviewed by Joseph Pecoraro.
* UserInterface/Base/Main.js:
(WI._paste):
Bail if `event.defaultPrevented`, as that means that something else has handled (and likely
overrode) this event.
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: the "x" in the Exception icon overlaps the border
https://bugs.webkit.org/show_bug.cgi?id=199553
Reviewed by Joseph Pecoraro.
* UserInterface/Images/Exception.svg:
* UserInterface/Images/Function.svg:
* UserInterface/Images/TailDeletedFunction.svg:
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: there should be a different icon for URL breakpoints
https://bugs.webkit.org/show_bug.cgi?id=199550
Reviewed by Joseph Pecoraro.
Use the same (down|up) arrow icon for the Network Tab and the Network timeline.
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement):
* UserInterface/Views/URLBreakpointTreeElement.css:
(.breakpoint.url:not(.breakpoint-paused-icon) .icon): Added.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel.prototype._addBreakpoint):
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
* UserInterface/Images/URLBreakpoint.svg: Added.
2019-07-08 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: CPU: the Duration string isn't localized
https://bugs.webkit.org/show_bug.cgi?id=199582
<rdar://problem/51698165>
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype._layoutEnergyChart):
* Localizations/en.lproj/localizedStrings.js:
2019-07-06 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property closed after editing values
https://bugs.webkit.org/show_bug.cgi?id=199090
<rdar://problem/51965431>
Reviewed by Devin Rousso.
`}` gets added by WI.tokenizeCSSValue (called by SpreadsheetStyleProperty.prototype._renderValue)
when it encounters unbalanced quotes. Fix unbalanced quotes by re-rendering the value from the model,
not the DOM content.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidCommit):
For consistency, render property name from the model as well.
2019-07-05 Devin Rousso <drousso@apple.com>
Web Inspector: current call frame indicator not visible in dark mode
https://bugs.webkit.org/show_bug.cgi?id=199047
<rdar://problem/51922895>
Reviewed by Timothy Hatcher.
* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame .status > .status-image):
(.tree-outline .item.call-frame.selected .status > .status-image):
Replace the CSS variables used for `fill` with their actual color value (in `light` mode),
as the semantic "name" of the variable doesn't really match its usage. As an example, the
current call frame shouldn't rely on the value of `--border-color`, as it's not a "border".
2019-07-05 Matt Baker <mattbaker@apple.com>
Web Inspector: Elements: use a CSS transition when showing/hiding DOM breakpoint gutter
https://bugs.webkit.org/show_bug.cgi?id=199411
Reviewed by Devin Rousso.
* UserInterface/Views/DOMTreeContentView.css:
(.content-view.dom-tree .tree-outline.dom):
2019-07-02 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: allow nodes to be copied and pasted
https://bugs.webkit.org/show_bug.cgi?id=199182
Reviewed by Matt Baker.
Copy is already supported, so there's nothing that needs to be done there.
Pasting is as simple as calling `insertAdjacentHTML("afterend", ...)` on the selected node.
* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI._paste): Added.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.handlePasteEvent): Added.
2019-07-02 Devin Rousso <drousso@apple.com>
Web Inspector: DOM Debugger: descendant breakpoints should be able to be enabled/disabled/deleted from a collapsed parent
https://bugs.webkit.org/show_bug.cgi?id=199332
Reviewed by Matt Baker.
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.get domBreakpoints):
(WI.DOMDebuggerManager.prototype.domBreakpointsForNode):
(WI.DOMDebuggerManager.prototype.domBreakpointsInSubtree): Added.
(WI.DOMDebuggerManager.prototype.removeDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._detachDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._detachBreakpointsForFrame):
(WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL):
(WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
Provide a way of getting a "summary" array of `DOMBreakpoint`s for all descendant nodes.
Rework the data structure for holding `DOMBreakpoint`s to use a `Multimap` so no duplicates
can be added (it uses a `Set` instead of an `Array`).
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.get hasBreakpoint):
(WI.DOMTreeElement.prototype.set breakpointStatus):
(WI.DOMTreeElement.prototype.bindRevealDescendantBreakpointsMenuItemHandler): Added.
(WI.DOMTreeElement.prototype._subtreeBreakpointChanged): Added.
(WI.DOMTreeElement.prototype._updateBreakpointStatus):
(WI.DOMTreeElement.prototype._statusImageContextmenu):
(WI.DOMTreeElement.prototype.subtreeBreakpointCountDidChange): Deleted.
* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.populateContextMenu):
* UserInterface/Views/ContextMenuUtilities.js:
(WI.appendContextMenuItemsForDOMNode):
(WI.appendContextMenuItemsForDOMNodeBreakpoints):
Keep track of the actual descendant `DOMNodeTreeElement` that have breakpoints, rather than
just a count, so that the "Reveal Descendant Breakpoints" action is able to access them.
Change "Reveal Descendant Breakpoints" to reveal and select all descendant breakpoints
instead of just the first one.
Drive-by: don't remove specific (event) listener breakpoints when invoking the
"Delete Descendant Breakpoints" action, as that's not obvious from the UI.
* UserInterface/Controllers/BreakpointPopoverController.js:
(WI.BreakpointPopoverController.prototype.appendContextMenuItems):
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement.prototype.populateContextMenu):
* UserInterface/Views/DOMNodeTreeElement.js:
(WI.DOMNodeTreeElement.prototype.populateContextMenu):
* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement.prototype.populateContextMenu):
* UserInterface/Views/URLBreakpointTreeElement.js:
(WI.URLBreakpointTreeElement.prototype.populateContextMenu):
Remove the separator before "Delete Breakpoint" so all breakpoint actions are in the same section.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Multimap.js:
(Multimap.prototype.get size): Added.
2019-07-02 Matt Baker <mattbaker@apple.com>
REGRESSION (r238563): Web Inspector: Selection is erratic when holding Up/Down on Network Table
https://bugs.webkit.org/show_bug.cgi?id=193841
<rdar://problem/47559124>
Reviewed by Devin Rousso.
Selecting and revealing a row after reloading Table data, but before the
layout that populates visible rows, could cause the Table to always be
scrolled so that the revealed row is first.
This patch fixes `revealRow` by calculating the position of the row being
revealed in the absence of its DOM element, so that the Table is only
scrolled when necessary.
* UserInterface/Views/Table.js:
(WI.Table.prototype.revealRow):
(WI.Table.prototype._resizeColumnsAndFiller):
Drive-by fix: use realOffsetWidth for consistency.
(WI.Table.prototype._updateVisibleRows):
(WI.Table.prototype._calculateOffsetHeight):
(WI.Table.prototype._calculateScrollTop):
2019-07-02 Devin Rousso <drousso@apple.com>
Web Inspector: Debug: "Reset Web Inspector" should also clear the saved window size and attachment side
https://bugs.webkit.org/show_bug.cgi?id=198956
Reviewed by Matt Baker.
* UserInterface/Base/Main.js:
(WI.reset): Added.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype._createDebugSettingsView):
2019-07-02 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: missing demo audits for WebInspectorAudit functions
https://bugs.webkit.org/show_bug.cgi?id=198719
Reviewed by Matt Baker.
Other than the LayoutTests, there's no way to see an example of the functionality of many of
the exposed `WebInspectorAudit` functions. There should be a demo audit for every exposed
function so they're more discoverable.
* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype._addDefaultTests):
(WI.AuditManager.prototype._addDefaultTests.removeWhitespace): Added.
Move all demo audit test functions to be actual JavaScript functions, which are then
stringified and stripped of unnecessary white-space.
* Localizations/en.lproj/localizedStrings.js:
2019-07-01 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r245498): Timelines: CPU: discontinuities are filled in by the next record
https://bugs.webkit.org/show_bug.cgi?id=198927
Reviewed by Matt Baker.
* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording):
(WI.TimelineRecording.prototype.start):
(WI.TimelineRecording.prototype.capturingStarted): Added.
(WI.TimelineRecording.prototype.capturingStopped): Added.
(WI.TimelineRecording.prototype.reset):
(WI.TimelineRecording.prototype.addRecord):
(WI.TimelineRecording.prototype.discontinuitiesInTimeRange):
(WI.TimelineRecording.prototype.addDiscontinuity): Deleted.
Notify the `TimelineRecording` when capturing has started/stopped.
Adjust the first record after a discontinuity to have it's `startTime` match the `endTime`
of the most recent discontinuity.
* UserInterface/Models/Timeline.js:
(WI.Timeline.prototype.addRecord):
* UserInterface/Models/CPUTimeline.js:
(WI.CPUTimeline.prototype.addRecord):
* UserInterface/Models/CPUTimelineRecord.js:
(WI.CPUTimelineRecord.prototype.adjustStartTime): Added.
(WI.CPUTimelineRecord.prototype.adjustStartTimeToLastRecord): Deleted.
* UserInterface/Models/MemoryTimeline.js:
(WI.MemoryTimeline.prototype.addRecord):
* UserInterface/Models/MemoryTimelineRecord.js:
(WI.MemoryTimelineRecord.prototype.adjustStartTime): Added.
(WI.MemoryTimelineRecord.prototype.adjustStartTimeToLastRecord): Deleted.
* UserInterface/Models/NetworkTimeline.js:
(WI.NetworkTimeline.prototype.addRecord):
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.prototype.layout):
* UserInterface/Views/MemoryTimelineOverviewGraph.js:
(WI.MemoryTimelineOverviewGraph.prototype.layout):
* UserInterface/Views/MemoryTimelineView.js:
(WI.MemoryTimelineView.prototype.layout):
Include discontinuities that exactly match the start/end time of the record immediately
before/after the discontinuity.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineCapturingStateChanged):
(WI.TimelineRecordingContentView.prototype._recordingReset):
Move the logic for handling discontinuity start/end times to the `TimelineRecording`.
* UserInterface/Base/Utilities.js:
2019-06-29 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Remove trailing white-space
https://bugs.webkit.org/show_bug.cgi?id=199346
Reviewed by Matt Baker.
* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager.prototype._initiatorCallFramesFromPayload):
* UserInterface/Images/Import.svg:
* UserInterface/Views/CanvasOverviewContentView.css:
(.navigation-bar > .item.canvas-recording-auto-capture > label > input):
* UserInterface/Views/DataGrid.css:
(.data-grid .resizer):
* UserInterface/Views/DatabaseContentView.css:
(.storage-view):
* UserInterface/Views/GoToLineDialog.css:
(@media (prefers-color-scheme: dark)):
* UserInterface/Views/GradientSlider.css:
(.gradient-slider > .add-area):
(.gradient-slider-knob > :matches(img, div)):
* UserInterface/Views/ResourceDetailsSection.css:
* UserInterface/Views/ScrubberNavigationItem.css:
(.navigation-bar .item.scrubber > input[disabled]):
* UserInterface/Views/SourceCodeTextEditor.css:
(.popover .expandable):
* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar.timeline-record-type-script.garbage-collected > .segment,):
* UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
(HeapSnapshotWorker.prototype.createSnapshot):
2019-06-29 Nikita Vasilyev <nvasilyev@apple.com>
Remove duplicate "Private" section and fix white space
Unreviewed code style fix.
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
2019-06-27 Beth Dakin <bdakin@apple.com>
Upstream use of MACCATALYST
https://bugs.webkit.org/show_bug.cgi?id=199245
rdar://problem/51687723
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig:
2019-06-27 Devin Rousso <drousso@apple.com>
Web Inspector: throw an error if console.count/console.countReset is called with an object that throws an error from toString
https://bugs.webkit.org/show_bug.cgi?id=199252
Reviewed by Joseph Pecoraro.
Add entries for `console.countReset` and `console.timeLog`.
Rename `title` to `label` for `console.time`, `console.timeLog`, and `console.timeEnd` to
better match the spec.
* UserInterface/Models/NativeFunctionParameters.js:
2019-06-26 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Update legacy backend commands after enum name change
https://bugs.webkit.org/show_bug.cgi?id=199250
Reviewed by Devin Rousso.
* UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js:
2019-06-26 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Elements: the forced pseudo-class indicator isn't visible when hovering
https://bugs.webkit.org/show_bug.cgi?id=199166
Reviewed by Matt Baker.
Make the pseudo-class indicator into its own element instead of being a `::before`.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement):
(WI.DOMTreeElement.prototype.updateSelectionArea):
(WI.DOMTreeElement.prototype.updateTitle):
(WI.DOMTreeElement.prototype._updatePseudoClassIndicator): Added.
(WI.DOMTreeElement.prototype.get pseudoClassesEnabled): Deleted.
(WI.DOMTreeElement.prototype._nodePseudoClassesDidChange): Deleted.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom):
(.tree-outline.dom li .pseudo-class-indicator): Added.
(body[dir=ltr] .tree-outline.dom li .pseudo-class-indicator): Added.
(body[dir=rtl] .tree-outline.dom li .pseudo-class-indicator): Added.
(.tree-outline.dom:focus li.selected .pseudo-class-indicator): Added.
(.tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(body[dir=ltr] .tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(body[dir=rtl] .tree-outline.dom li.pseudo-class-enabled > .selection-area::before): Deleted.
(.tree-outline.dom:focus li.selected.pseudo-class-enabled > .selection-area::before): Deleted.
* UserInterface/Views/FormattedValue.css:
(.formatted-node > .tree-outline.dom):
Adjust the indent of any `DOMTreeOutline` so there's more room for the pseudo-class
indicator, such as in the Console.
2019-06-25 Matt Baker <mattbaker@apple.com>
Web Inspector: Elements: show shadow DOM by default
https://bugs.webkit.org/show_bug.cgi?id=199128
Reviewed by Devin Rousso.
* UserInterface/Base/Setting.js:
* UserInterface/Test/Test.js:
(WI.loaded):
Overriding the default value isn't necessary since the default is now true.
2019-06-25 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r246621): Web Inspector: Styles: property may get removed when editing after deleting value
https://bugs.webkit.org/show_bug.cgi?id=199143
<rdar://problem/52042815>
Reviewed by Matt Baker.
r246621 affected when WI.CSSStyleDeclaration.Event.PropertiesChanged event is fired, which caused
SpreadsheetCSSStyleDeclarationEditor to possibly enter a state when `focused` property is
incorrectly set to false.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved): Removed.
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyWillRemove): Added.
Renamed from "removed" to "willRemove" since we need to call it before the property DOM element
is detached from the document.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.remove):
Don't set focused to false when the removed property wasn't focused.
This code need to exist because removing focused element from the DOM doesn't trigger blur event.
2019-06-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Implement console.timeLog
https://bugs.webkit.org/show_bug.cgi?id=199184
Reviewed by Devin Rousso.
* UserInterface/Views/ConsoleMessageView.js:
(WI.ConsoleMessageView.prototype._appendMessageTextAndArguments):
Time messages (like timeLog) do not include their messageText
in their parameters list. So to behave more like normal logs
build a parameter list that includes it at the front.
2019-06-23 Matt Baker <mattbaker@apple.com>
Web Inspector: REGRESSION (r246684): Dark Mode: dashboard buttons should have no background
https://bugs.webkit.org/show_bug.cgi?id=199136
<rdar://problem/52035798>
Reviewed by Joseph Pecoraro.
* UserInterface/Views/DefaultDashboardView.css:
(@media (prefers-color-scheme: dark)):
(.toolbar .dashboard .item.button,):
2019-06-23 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: show green highlight for newly added properties only when name and value are present
https://bugs.webkit.org/show_bug.cgi?id=199131
Reviewed by Matt Baker.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.updateStatus):
2019-06-22 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r241980): Web Inspector: Styles: Pressing Tab/Enter on last property no longer focuses on selector on next rule
https://bugs.webkit.org/show_bug.cgi?id=199125
<rdar://problem/52011182>
Reviewed by Matt Baker.
Since SpreadsheetSelectorField's focus handler was removed in r241980, focusing on the selector element
doesn't start editing it.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.startEditingRuleSelector):
2019-06-22 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: Styles: unbalanced quotes and parenthesis aren't displayed as property closed after editing values
https://bugs.webkit.org/show_bug.cgi?id=199090
<rdar://problem/51965431>
Reviewed by Matt Baker.
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.spreadsheetTextFieldDidBlur):
Unbalanced quotes and parenthesis are fixed inside of CSSProperty's rawValue setter.
Render the value from the model, not the view.
2019-06-21 Matt Baker <mattbaker@apple.com>
Web Inspector: remove unused DataGrid style .force-focus
https://bugs.webkit.org/show_bug.cgi?id=199112
<rdar://problem/51993412>
Reviewed by Timothy Hatcher.
* UserInterface/Views/HeapAllocationsTimelineView.css:
(.timeline-view.heap-allocations > .data-grid:not(:focus) tr.selected.invalid):
(.timeline-view.heap-allocations > .data-grid:not(:focus, .force-focus) tr.selected.invalid): Deleted.
* UserInterface/Views/ResourceTreeElement.css:
(.item.resource.resource-type-websocket:not(.selected) .status .ready-state.open,):
(.item.resource.resource-type-websocket:not(.selected) .status .ready-state.connecting,):
Missed in https://bugs.webkit.org/show_bug.cgi?id=190480.
2019-06-21 Matt Baker <mattbaker@apple.com>
Web Inspector: remove .legacy-mac/.latest-mac CSS classes, standardize on .latest-mac UI
https://bugs.webkit.org/show_bug.cgi?id=199109
<rdar://problem/51991129>
Reviewed by Timothy Hatcher.
Drop legacy macOS version support from Web Inspector UI.
* UserInterface/Base/Main.js:
* UserInterface/Views/DefaultDashboardView.css:
(@media (prefers-color-scheme: dark)):
(body.latest-mac .toolbar .dashboard .item.button): Deleted.
* UserInterface/Views/Toolbar.css:
(.toolbar):
(.toolbar .item.button,):
(.toolbar .search-bar > input[type="search"]):
(.toolbar .search-bar > input[type="search"]:focus):
(@media (-webkit-min-device-pixel-ratio: 2)):
(.toolbar .item.button:active):
(body.window-inactive .toolbar .item.button,):
(@media (prefers-color-scheme: dark)):
(.toolbar .search-bar > input[type="search"]::placeholder):
(body.window-inactive .toolbar .search-bar > input[type="search"]::placeholder):
(body.window-inactive .toolbar .search-bar > input[type="search"]::-webkit-search-results-button):
(.toolbar .dashboard-container):
(body .toolbar): Deleted.
(body.legacy-mac .toolbar .item.button,): Deleted.
(body.legacy-mac .toolbar .search-bar > input[type="search"]): Deleted.
(body.legacy-mac .toolbar .search-bar > input[type="search"]:focus): Deleted.
(body.legacy-mac .toolbar .item.button:active): Deleted.
(body.window-inactive.legacy-mac .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]:focus): Deleted.
(body.latest-mac .toolbar .item.button:active): Deleted.
(body.latest-mac.window-inactive .toolbar .item.button,): Deleted.
(body.latest-mac .toolbar .search-bar > input[type="search"]::placeholder): Deleted.
(body.latest-mac.window-inactive .toolbar .search-bar > input[type="search"]::placeholder): Deleted.
(body.latest-mac.window-inactive .toolbar .search-bar > input[type="search"]::-webkit-search-results-button): Deleted.
(body.latest-mac .toolbar .dashboard-container): Deleted.
2019-06-20 Matt Baker <mattbaker@apple.com>
Web Inspector: rename shadowRootPushed parameter to match protocol
https://bugs.webkit.org/show_bug.cgi?id=199098
Reviewed by Devin Rousso.
* UserInterface/Protocol/DOMObserver.js:
(WI.DOMObserver.prototype.shadowRootPushed):
2019-06-20 Devin Rousso <drousso@apple.com>
Web Inspector: Error "null is not an object (evaluating 'syntaxTree.containersOfPosition')" when setting a breakpoint
https://bugs.webkit.org/show_bug.cgi?id=199082
Reviewed by Matt Baker.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorExecutionHighlightRange):
The script syntax tree may be fetched even if the resource hasn't finished parsing (or had
a syntax error), so it's possible for it to be `null`.
2019-06-20 Devin Rousso <drousso@apple.com>
Web Inspector: Dark Mode: inactive tab bar item should get darker on hover
https://bugs.webkit.org/show_bug.cgi?id=199022
Reviewed by Darin Adler.
* UserInterface/Views/TabBar.css:
(.tab-bar:not(.animating) > .item:not(.selected, .disabled):hover):
(@media not (prefers-color-scheme: dark) .tab-bar:not(.animating) > .item:not(.selected, .disabled):hover > .icon):
(@media (prefers-color-scheme: dark) .tab-bar):
(@media (prefers-color-scheme: dark) .tab-bar > .item):
(@media (prefers-color-scheme: dark) .tab-bar > .item:not(.disabled).selected):
(@media (prefers-color-scheme: dark) .tab-bar:not(.animating) > .item:not(.selected):hover):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar > .item):
(@media (prefers-color-scheme: dark) body.window-inactive .tab-bar > .item.selected):
* UserInterface/Views/Toolbar.css:
(@media (prefers-color-scheme: dark) body .toolbar):
2019-06-20 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: setting a breakpoint on a non-JavaScript line should immediately show as unresolved
https://bugs.webkit.org/show_bug.cgi?id=199033
Reviewed by Matt Baker.
Remove the `shouldSpeculativelyResolve` parameter, as it was resolving breakpoints even in
the case that there were no resolved locations for the given breakpoint.
In the case that there are resolved locations, the breakpoint would've already been resolved
by the time that `shouldSpeculativelyResolve` would've taken effect, so it's unnecessary.
This parameter was only used when setting a breakpoint from a `SourceCodeTextEditor` gutter.
* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager.prototype.addBreakpoint):
(WI.DebuggerManager.prototype._setBreakpoint):
(WI.DebuggerManager.prototype._setBreakpoint.didSetBreakpoint):
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.textEditorBreakpointAdded):
2019-06-20 Devin Rousso <drousso@apple.com>
Web Inspector: Edit -> Tag doesn't do anything for html, head, and body elements
https://bugs.webkit.org/show_bug.cgi?id=199052
<rdar://problem/51923906>
Reviewed by Matt Baker.
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype.populateDOMNodeContextMenu):
- Don't show an "Edit > Tag" for <html>, <head>, and <body> nodes
- Disable any "Edit" submenu item if it's target is already being edited
- Prevent "Add" submenu items from being shown for text nodes
2019-06-19 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Debugger: current call frame indicator isn't vertically centered
https://bugs.webkit.org/show_bug.cgi?id=199015
Reviewed by Matt Baker.
* UserInterface/Views/CallFrameTreeElement.css:
(.tree-outline .item.call-frame .status):
2019-06-19 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues
https://bugs.webkit.org/show_bug.cgi?id=198505
<rdar://problem/51374780>
Reviewed by Matt Baker.
Since r240946, setting WI.CSSStyleDeclaration.prototype.text updates the text immediately.
When WI.CSSStyleDeclaration.prototype.update gets called after setting text, it exits early
without firing WI.CSSStyleDeclaration.Event.PropertiesChanged.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.set text):
2019-06-19 Matt Baker <mattbaker@apple.com>
Web Inspector: Remove unused _pendingFilter from NetworkTableContentView
https://bugs.webkit.org/show_bug.cgi?id=199026
Reviewed by Devin Rousso.
This flag is no longer set as of https://trac.webkit.org/changeset/225895.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype._processPendingEntries):
2019-06-19 Devin Rousso <drousso@apple.com>
Web Inspector: Uncaught Exception: TypeError: undefined is not an object (evaluating 'sourceCodePosition.lineNumber')
https://bugs.webkit.org/show_bug.cgi?id=199019
Reviewed by Matt Baker.
* UserInterface/Base/Main.js:
(WI.linkifyLocation):
2019-06-19 Zhifei Fang <zhifei_fang@apple.com>
Correct the error object link color in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=198033
Reviewed by Devin Rousso.
* UserInterface/Views/ErrorObjectView.css:
(@media (prefers-dark-interface)):
(.error-object-link-container):
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: Network: detail view shouldn't stay open when the related entry is removed
https://bugs.webkit.org/show_bug.cgi?id=198951
Reviewed by Joseph Pecoraro.
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype._mainResourceDidChange):
Hide the detail view if the main resource changes and we aren't preserving the log.
* UserInterface/Views/Table.js:
(WI.Table.prototype.reloadVisibleColumnCells):
Only attempt to populate cells for rows that the `_dataSource` actually has. Without this,
the `_delegate` may be asked to populate a cell for a row it doesn't have, which would error.
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: parseQueryParameters fails to successfully parse query parameter values that contain "="
https://bugs.webkit.org/show_bug.cgi?id=198971
<rdar://problem/51852782>
Reviewed by Joseph Pecoraro.
* UserInterface/Base/URLUtilities.js:
(parseQueryString):
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Heap: subsequent snapshots taken manually don't appear in the list
https://bugs.webkit.org/show_bug.cgi?id=198941
Reviewed by Joseph Pecoraro.
Since heap snapshot records can be added at any time, including when not actively recording,
when the "Entire Recording" range is selected, make sure to set the `filterEndTime` to be an
effectively infinite number so that records added later aren't filtered out.
This isn't done for other timeline views as they may have graphs that don't expect to render
from time 0 till infinity, not to mention being unable to add records when not recording.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView.prototype._updateTimelineViewTimes):
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Canvas: cannot select saved recordings
https://bugs.webkit.org/show_bug.cgi?id=198953
Reviewed by Joseph Pecoraro.
* UserInterface/Views/TreeElement.js:
(WI.TreeElement.treeElementToggled):
Don't early return if the `TreeElement` isn't `selectable` as the owner `TreeOutline` may
want to dispatch an event that it was clicked.
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: the initial state should be selected when processing a new/imported recording if the navigation sidebar is collapsed
https://bugs.webkit.org/show_bug.cgi?id=198952
Reviewed by Joseph Pecoraro.
Prevent any content from being generated until `initialLayout` is called, as otherwise it's
possible for the `CanvasNavigationSidebar` to update the current action index before the
preview element has been created, which would throw an error.
* UserInterface/Views/RecordingContentView.js:
(WI.RecordingContentView.prototype.updateActionIndex):
(WI.RecordingContentView.prototype.initialLayout):
(WI.RecordingContentView.prototype._updateSliderValue):
(WI.RecordingContentView.prototype._handleRecordingProcessedAction):
Drive-by: update the slider max each time the selected action index is changed.
2019-06-18 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: imported recordings aren't selectable from the overview if there are no canvases in the page
https://bugs.webkit.org/show_bug.cgi?id=198955
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._addSavedRecording):
Hide the content placeholder when a recording is imported. It won't be shown again because
the `subviews` list will never be empty, as there's no way to remove an imported recording.
* UserInterface/Views/CollectionContentView.js:
(WI.CollectionContentView.prototype.addContentViewForItem):
(WI.CollectionContentView.prototype.removeContentViewForItem):
(WI.CollectionContentView.prototype.showContentPlaceholder): Added.
(WI.CollectionContentView.prototype.hideContentPlaceholder): Added.
(WI.CollectionContentView.prototype.initialLayout):
(WI.CollectionContentView.prototype._selectItem):
(WI.CollectionContentView.prototype._showContentPlaceholder): Deleted.
(WI.CollectionContentView.prototype._hideContentPlaceholder): Deleted.
Make `showContentPlaceholder`/`hideContentPlaceholder` protected for any subclasses to call.
2019-06-17 Matt Baker <mattbaker@apple.com>
Web Inspector: Elements: remove ellipses from "Break on" context menu item title
https://bugs.webkit.org/show_bug.cgi?id=198944
Reviewed by Devin Rousso.
Update context menu title to comply with Apple HI guidelines.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ContextMenuUtilities.js:
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: adding a DOM/Event/URL breakpoint should enable breakpoints
https://bugs.webkit.org/show_bug.cgi?id=198932
Reviewed by Matt Baker.
Match the behavior of JavaScript breakpoints, which enable breakpoints globally when a new
breakpoint is set or an existing breakpoint is enabled.
This avoids the situation where setting a DOM breakpoint or a specific event listener
breakpoint appears to not "work" because breakpoints are globally disabled. There is no
"breakpoints disabled" banner in the Elements tab, so the user could be completely unaware
of this, and therefore be confused as to why these breakpoints aren't being hit.
* UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype._updateEventBreakpoint):
* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
(WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: remove extra space above Breakpoints section when breakpoints are disabled
https://bugs.webkit.org/show_bug.cgi?id=198933
Reviewed by Matt Baker.
* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .warning-banner):
* UserInterface/Views/SourcesNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.sources > .content > .warning-banner):
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: split the General panel into sub panels so it's less crowded
https://bugs.webkit.org/show_bug.cgi?id=198803
Reviewed by Timothy Hatcher.
* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView.prototype.initialLayout):
(WI.SettingsTabContentView.prototype._createGeneralSettingsView):
Many of the settings in General only affect a specific part of Web Inspector, and therefore
aren't really "general".
(WI.SettingsTabContentView.prototype._createElementsSettingsView): Added.
- Element Selection
- CSS Changes
(WI.SettingsTabContentView.prototype._createSourcesSettingsView): Added.
- Debugger
- Source Maps
(WI.SettingsTabContentView.prototype._createConsoleSettingsView): Added.
- Traces (renamed from "Console")
- WebRTC Logging
- Media Logging
- MSE Logging
* Localizations/en.lproj/localizedStrings.js:
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: the Inspector Style Sheet is missing when grouped by path
https://bugs.webkit.org/show_bug.cgi?id=198860
Reviewed by Timothy Hatcher.
* UserInterface/Controllers/CSSManager.js:
(WI.CSSManager.prototype.get styleSheets):
(WI.CSSManager.prototype.inspectorStyleSheetsForFrame):
(WI.CSSManager.prototype.preferredInspectorStyleSheetForFrame):
(WI.CSSManager.prototype._inspectorStyleSheetsForFrame): Deleted.
Expose a way to fetch all inspector stylesheets for a given frame.
Make sure to associate inspector stylesheets with their frame.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel.prototype._compareTreeElements):
(WI.SourcesNavigationSidebarPanel.prototype._addResourcesRecursivelyForFrame):
(WI.SourcesNavigationSidebarPanel.prototype._handleCSSStyleSheetAdded):
Add paths for inspector stylesheet creation/fetching when grouping by path.
Sort inspector stylesheets as the first item of an origin/frame when grouping by path.
2019-06-17 Jamal Nasser <jamaln@mail.com>
Web Inspector: Go To Line dialog is white when in Dark Mode
https://bugs.webkit.org/show_bug.cgi?id=198596
Reviewed by Timothy Hatcher.
* UserInterface/Views/GoToLineDialog.css:
(@media (prefers-color-scheme: dark)):
(.go-to-line-dialog):
(.go-to-line-dialog > div > input):
(.go-to-line-dialog > div > input::placeholder):
(.go-to-line-dialog > div::before):
2019-06-17 Devin Rousso <drousso@apple.com>
Web Inspector: Sources: searching doesn't use the case sensitive or regex global settings
https://bugs.webkit.org/show_bug.cgi?id=198897
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.customPerformSearch):
2019-06-13 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r246178): extra spaces added in at-rules when formatting CSS
https://bugs.webkit.org/show_bug.cgi?id=198806
Reviewed by Joseph Pecoraro.
* UserInterface/Workers/Formatter/CSSFormatter.js:
(CSSFormatter.prototype._format):
Add more specific tests for at-rules, and add/remove whitespace depending on the type of
at-rule (e.g. `@supports` vs `@media`), as well as where the scanner is in the parameters of
the at at-rule (e.g. `@supports |` vs `@media (|`).
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder):
(FormatterContentBuilder.prototype.get lastToken): Added.
(FormatterContentBuilder.prototype.get currentLine):
(FormatterContentBuilder.prototype.removeLastNewline):
(FormatterContentBuilder.prototype.removeLastWhitespace):
(FormatterContentBuilder.prototype._popFormattedContent):
(FormatterContentBuilder.prototype._append):
Update `lastTokenWasNewline` and `lastTokenWasWhitespace` when removing newlines/whitespace.
Memoize the `currentLine` so it's less expensive to re-fetch.
2019-06-13 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: indent type and size settings aren't respected everywhere
https://bugs.webkit.org/show_bug.cgi?id=198804
Reviewed by Timothy Hatcher.
* UserInterface/Views/CodeMirrorEditor.js:
(WI.CodeMirrorEditor.create):
When creating a `CodeMirror` instance, default to using the global `Setting`s as the options.
If an override is specified in `options`, it will take precedence and the `CodeMirror` will
ignore any changes to the `Setting` as well.
* UserInterface/Views/TextEditor.js:
(WI.TextEditor):
(WI.TextEditor.prototype.close): Deleted.
* UserInterface/Views/AuditTestCaseContentView.js:
(WI.AuditTestCaseContentView.prototype.layout):
* UserInterface/Views/BreakpointActionView.js:
(WI.BreakpointActionView.prototype._updateBody):
* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WI.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
Remove overrides that aren't necessary for `CodeMirror` to fit in the container element:
- `showWhitespaceCharacters`
- `indentWithTabs`
- `indentUnit`
* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.close):
* UserInterface/Views/ShaderProgramContentView.js:
(WI.ShaderProgramContentView.prototype.closed): Deleted.
* UserInterface/Views/TextContentView.js:
(WI.TextContentView.prototype.closed): Deleted.
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype.closed):
Delete the logic for removing event listeners from global `Setting`, as it didn't work
anyways, since none of the event listeners were added using a `thisObject`.
2019-06-13 Devin Rousso <drousso@apple.com>
Web Inspector: Settings: sticky header disappears when over scrolling
https://bugs.webkit.org/show_bug.cgi?id=198833
Reviewed by Joseph Pecoraro.
* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings .navigation-bar):
(.content-view.settings > .settings-view): Added.
(.content-view.settings): Deleted.
2019-06-10 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: imported recordings do not have JavaScript call trees
https://bugs.webkit.org/show_bug.cgi?id=197490
<rdar://problem/50589158>
Reviewed by Joseph Pecoraro.
* UserInterface/Models/TimelineRecording.js:
(WI.TimelineRecording.prototype.initializeCallingContextTrees):
Make sure to actually save the provided stack traces and samples in the export data.
* UserInterface/Models/ScriptTimelineRecord.js:
(WI.ScriptTimelineRecord.fromJSON):
(WI.ScriptTimelineRecord.prototype.toJSON):
Drive-by: include `extraDetails`, which contains useful information like "default prevented".
2019-06-10 Nikita Vasilyev <nvasilyev@apple.com>
REGRESSION(r244268): Web Inspector: Styles: navigating from Computed to Styles doesn't work
https://bugs.webkit.org/show_bug.cgi?id=198508
<rdar://problem/51375503>
Reviewed by Matt Baker.
It didn't work because the detached sidebar panel tried to access its parent view (this.parentSidebar).
* UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
(WI.ComputedStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Added.
(WI.ComputedStyleDetailsSidebarPanel):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Deleted.
Move computedStyleDetailsPanelShowProperty to ComputedStyleDetailsSidebarPanel since it's the only
panel where it's needed.
2019-06-10 Alexey Shvayka <shvaikalesh@gmail.com>
Web Inspector: "Copy Path to Property" doesn't work with multiline keys
https://bugs.webkit.org/show_bug.cgi?id=198691
Reviewed by Matt Baker.
Correctly escape line terminators to prevent doubleQuotedString from returning malformed strings.
* UserInterface/Base/Utilities.js: Use JSON.stringify.
2019-06-10 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r246025): prototypes in object previews are visible even when setting `showOnlyJSON`
https://bugs.webkit.org/show_bug.cgi?id=198721
Reviewed by Joseph Pecoraro.
* UserInterface/Views/ObjectTreeView.css:
(.object-tree.properties-only.json-only .object-tree-property.prototype-property): Added.
(.object-tree.properties-only.json-only .object-tree-property .prototype-property): Deleted.
2019-06-07 Nikita Vasilyev <nvasilyev@apple.com>
Web Inspector: longhand CSS properties overridden by shorthands miss strikethrough
https://bugs.webkit.org/show_bug.cgi?id=198629
<rdar://problem/51504160>
Reviewed by Devin Rousso.
Longhand CSS properties (e.g. "font-size") overriden by shorthands (e.g. "font") now have strikethroughs.
* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype.set overridingProperty):
(WI.CSSProperty):
* UserInterface/Models/DOMNodeStyles.js:
(WI.DOMNodeStyles.prototype._updateStyleCascade):
Call _associateRelatedProperties before _markOverriddenProperties because
_associateRelatedProperties sets relatedShorthandProperty property, which
is now used by _markOverriddenProperties.
(WI.DOMNodeStyles.prototype._markOverriddenProperties.isOverriddenBy):
(WI.DOMNodeStyles.prototype._markOverriddenProperties):
2019-06-06 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: remove always disabled details sidebar navigation item
https://bugs.webkit.org/show_bug.cgi?id=198393
Reviewed by Timothy Hatcher.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
2019-06-06 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r245833): Timelines: CPU: JavaScript label is missing and JavaScript section of pie chart is black
https://bugs.webkit.org/show_bug.cgi?id=198627
Reviewed by Joseph Pecoraro.
* UserInterface/Views/CPUTimelineView.js:
(WI.CPUTimelineView.displayNameForSampleType):
* UserInterface/Views/CPUTimelineView.css:
(.timeline-view.cpu > .content > .overview .legend > .row > .swatch.sample-type-javascript):
(.timeline-view.cpu .circle-chart > svg > path.segment.sample-type-javascript): Added.
(.timeline-view.cpu .circle-chart > svg > path.segment.sample-type-script): Deleted.
* UserInterface/Views/CPUUsageCombinedView.css:
(.cpu-usage-combined-view > .graph > .range-chart .sample-type-javascript): Added.
(.cpu-usage-combined-view > .graph > .range-chart .sample-type-script): Deleted.
Use the enum string added in r245833 (`sample-type-javascript`) instead of what was there
before (`sample-type-script`).
* UserInterface/Views/Variables.css:
(:root):
Rename `--cpu-script-*` to `--cpu-javascript-*`.
2019-06-06 Devin Rousso <drousso@apple.com>
Web Inspector: Formatter: pretty-print CSS using a Worker
https://bugs.webkit.org/show_bug.cgi?id=197829
<rdar://problem/36891532>
Reviewed by Timothy Hatcher.
* UserInterface/Proxies/FormatterWorkerProxy.js:
(WI.FormatterWorkerProxy.prototype.formatCSS): Added.
* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatCSS): Added.
* UserInterface/Workers/Formatter/CSSFormatter.js: Added.
(CSSFormatter):
(CSSFormatter.prototype.get success):
(CSSFormatter.prototype.get formattedText):
(CSSFormatter.prototype.get sourceMapData):
(CSSFormatter.prototype._format):
* UserInterface/Workers/Formatter/FormatterContentBuilder.js:
(FormatterContentBuilder.prototype.get currentLine): Added.
* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype._canUseFormatterWorker):
(WI.TextEditor.prototype._startWorkerPrettyPrint):
* .eslintrc:
2019-06-06 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: print/rulers/compositing/paint navigation items shouldn't be visible if the inspected target doesn't have a PageAgent
https://bugs.webkit.org/show_bug.cgi?id=198410
Reviewed by Timothy Hatcher.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView):
(WI.DOMTreeContentView.prototype.get navigationItems):
(WI.DOMTreeContentView.prototype._showRulersChanged):
== Rolled over to ChangeLog-2019-06-05 ==