⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243715 in webkit


Ignore:
Timestamp:
Apr 1, 2019, 2:50:02 PM (7 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Debugger: breakpoints don't populate in inspector2 on first load
https://bugs.webkit.org/show_bug.cgi?id=196063
<rdar://problem/49097787>

Reviewed by Joseph Pecoraro.

In the case that a breakpoint becomes resolved after the resource has finished loaded, there
won't be an already existing TreeElement for the breakpoint to replace.

This can realistically only happen if the IndexedDB lookup is super slow, or the resource is
extremely fast (e.g. a data url).

  • UserInterface/Views/DebuggerSidebarPanel.js:

(WI.DebuggerSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
(WI.DebuggerSidebarPanel.prototype._addDebuggerObject): Deleted.

  • UserInterface/Views/SourcesNavigationSidebarPanel.js:

(WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
(WI.SourcesNavigationSidebarPanel.prototype._addBreakpointsForSourceCode):
(WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r243704 r243715  
     12019-04-01  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Debugger: breakpoints don't populate in inspector2 on first load
     4        https://bugs.webkit.org/show_bug.cgi?id=196063
     5        <rdar://problem/49097787>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        In the case that a breakpoint becomes resolved after the resource has finished loaded, there
     10        won't be an already existing `TreeElement` for the breakpoint to replace.
     11
     12        This can realistically only happen if the IndexedDB lookup is super slow, or the resource is
     13        extremely fast (e.g. a `data` url).
     14
     15        * UserInterface/Views/DebuggerSidebarPanel.js:
     16        (WI.DebuggerSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
     17        (WI.DebuggerSidebarPanel.prototype._addDebuggerObject): Deleted.
     18
     19        * UserInterface/Views/SourcesNavigationSidebarPanel.js:
     20        (WI.SourcesNavigationSidebarPanel.prototype._addBreakpoint):
     21        (WI.SourcesNavigationSidebarPanel.prototype._addBreakpointsForSourceCode):
     22        (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerObjectDisplayLocationDidChange):
     23
    1242019-04-01  Joseph Pecoraro  <pecoraro@apple.com>
    225
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js

    r243244 r243715  
    823823            return;
    824824
    825         var debuggerTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(debuggerObject);
    826         if (!debuggerTreeElement)
    827             return;
    828 
    829         // A known debugger object (breakpoint, issueMessage, etc.) moved between resources, remove the old tree element
    830         // and create a new tree element with the updated file.
    831 
    832         var wasSelected = debuggerTreeElement.selected;
    833 
    834         this._removeDebuggerTreeElement(debuggerTreeElement);
    835         var newDebuggerTreeElement = this._addDebuggerObject(debuggerObject);
    836 
    837         if (newDebuggerTreeElement && wasSelected)
     825        // A known debugger object (breakpoint, issueMessage, etc.) moved between resources. Remove
     826        // the old tree element and create a new tree element with the updated file.
     827
     828        let wasSelected = false;
     829        let oldDebuggerTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(debuggerObject);
     830        if (oldDebuggerTreeElement)
     831            wasSelected = oldDebuggerTreeElement.selected;
     832
     833        let newDebuggerTreeElement = null;
     834        if (debuggerObject instanceof WI.Breakpoint)
     835            newDebuggerTreeElement = this._addBreakpoint(debuggerObject);
     836        else if (debuggerObject instanceof WI.IssueMessage)
     837            newDebuggerTreeElement = this._addIssue(debuggerObject);
     838        if (!newDebuggerTreeElement)
     839            return;
     840
     841        if (oldDebuggerTreeElement)
     842            this._removeDebuggerTreeElement(oldDebuggerTreeElement);
     843
     844        if (wasSelected)
    838845            newDebuggerTreeElement.revealAndSelect(true, false, true);
    839846    }
     
    13701377    }
    13711378
    1372     _addDebuggerObject(debuggerObject)
    1373     {
    1374         if (debuggerObject instanceof WI.Breakpoint)
    1375             return this._addBreakpoint(debuggerObject);
    1376 
    1377         if (debuggerObject instanceof WI.IssueMessage)
    1378             return this._addIssue(debuggerObject);
    1379 
    1380         return null;
    1381     }
    1382 
    13831379    _addIssue(issueMessage)
    13841380    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js

    r243300 r243715  
    864864    _addBreakpoint(breakpoint)
    865865    {
     866        if (this._breakpointsTreeOutline.findTreeElement(breakpoint))
     867            return null;
     868
    866869        let constructor = WI.BreakpointTreeElement;
    867870        let options = {};
     
    876879            if (!domNodeTreeElement) {
    877880                domNodeTreeElement = new WI.DOMNodeTreeElement(domNode);
    878                 this._insertDebuggerTreeElement(domNodeTreeElement, parentTreeElement);
     881                this._insertDebuggerTreeElement(domNodeTreeElement, this._breakpointsTreeOutline);
    879882            }
    880883            return domNodeTreeElement;
     
    911914                        const subtitle = null;
    912915                        eventTargetTreeElement = new WI.GeneralTreeElement(["event-target-window"], WI.unlocalizedString("window"), subtitle, SourcesNavigationSidebarPanel.__windowEventTargetRepresentedObject);
    913                         this._insertDebuggerTreeElement(eventTargetTreeElement, parentTreeElement);
     916                        this._insertDebuggerTreeElement(eventTargetTreeElement, this._breakpointsTreeOutline);
    914917                    }
    915918                } else if (breakpoint.eventListener.node)
     
    928931            let sourceCode = breakpoint.sourceCodeLocation && breakpoint.sourceCodeLocation.displaySourceCode;
    929932            if (!sourceCode)
    930                 return null;
    931 
    932             if (this._breakpointsTreeOutline.findTreeElement(breakpoint))
    933933                return null;
    934934
     
    10331033    {
    10341034        for (let breakpoint of WI.debuggerManager.breakpointsForSourceCode(sourceCode))
    1035             this._addBreakpoint(breakpoint, sourceCode);
     1035            this._addBreakpoint(breakpoint);
    10361036    }
    10371037
     
    17621762        if (debuggerObject instanceof WI.Breakpoint) {
    17631763            oldDebuggerTreeElement = this._breakpointsTreeOutline.findTreeElement(debuggerObject);
    1764             if (oldDebuggerTreeElement) {
    1765                 newDebuggerTreeElement = this._addBreakpoint(debuggerObject);
     1764            if (oldDebuggerTreeElement)
    17661765                wasSelected = oldDebuggerTreeElement.selected;
    1767             }
     1766
     1767            newDebuggerTreeElement = this._addBreakpoint(debuggerObject);
    17681768        } else if (debuggerObject instanceof WI.IssueMessage) {
    17691769            oldDebuggerTreeElement = this._resourcesTreeOutline.findTreeElement(debuggerObject);
    1770             if (oldDebuggerTreeElement) {
    1771                 newDebuggerTreeElement = this._addIssue(debuggerObject);
     1770            if (oldDebuggerTreeElement)
    17721771                wasSelected = oldDebuggerTreeElement.selected;
    1773             }
    1774         }
     1772
     1773            newDebuggerTreeElement = this._addIssue(debuggerObject);
     1774        }
     1775
     1776        if (!newDebuggerTreeElement)
     1777            return;
    17751778
    17761779        if (oldDebuggerTreeElement)
    17771780            this._removeDebuggerTreeElement(oldDebuggerTreeElement);
    17781781
    1779         if (newDebuggerTreeElement && wasSelected)
     1782        if (wasSelected)
    17801783            newDebuggerTreeElement.revealAndSelect(true, false, true);
    17811784    }
Note: See TracChangeset for help on using the changeset viewer.