<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[213691] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/213691">213691</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2017-03-09 16:53:48 -0800 (Thu, 09 Mar 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Add XHR breakpoints UI
https://bugs.webkit.org/show_bug.cgi?id=168763
<rdar://problem/30952439>
Reviewed by Joseph Pecoraro.
Source/JavaScriptCore:
* inspector/protocol/DOMDebugger.json:
Added clarifying comments to command descriptions.
Source/WebCore:
Test: inspector/dom-debugger/xhr-breakpoints.html
* inspector/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::discardBindings):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
Don't break for XHRs when breakpoints are disabled.
Source/WebInspectorUI:
* Localizations/en.lproj/localizedStrings.js:
New UI strings.
* UserInterface/Controllers/DOMDebuggerManager.js:
Plumbing for XHR breakpoints. Like DOM breakpoints, they are tracked
per-page. Unlike DOM breakpoints, they have no separate "resolved"
state, and are simply added/removed as the main frame changes.
(WebInspector.DOMDebuggerManager):
(WebInspector.DOMDebuggerManager.prototype.get allRequestsBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.get xhrBreakpoints):
(WebInspector.DOMDebuggerManager.prototype.isBreakpointRemovable):
(WebInspector.DOMDebuggerManager.prototype.removeDOMBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.addXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype.removeXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints):
(WebInspector.DOMDebuggerManager.prototype._detachXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint.breakpointUpdated):
(WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._resolveXHRBreakpoint):
(WebInspector.DOMDebuggerManager.prototype._saveXHRBreakpoints):
(WebInspector.DOMDebuggerManager.prototype._domBreakpointDisabledStateDidChange):
(WebInspector.DOMDebuggerManager.prototype._xhrBreakpointDisabledStateDidChange):
(WebInspector.DOMDebuggerManager.prototype._mainResourceDidChange):
(WebInspector.DOMDebuggerManager.prototype._saveBreakpoints): Deleted.
Renamed `saveDOMBreakpoints`.
* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype._pauseReasonFromPayload):
Plumbing for XHR breakpoint pause reason.
* UserInterface/Controllers/XHRBreakpointTreeController.js: Added.
Creates the "All Requests" breakpoint, handles DOMDebuggerManager messages,
and updates an associated tree outline as XHR breakpoints are added and removed.
(WebInspector.XHRBreakpointTreeController):
(WebInspector.XHRBreakpointTreeController.prototype.revealAndSelect):
(WebInspector.XHRBreakpointTreeController.prototype.disconnect):
(WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointAdded):
(WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointRemoved):
(WebInspector.XHRBreakpointTreeController.prototype._mainResourceDidChange):
(WebInspector.XHRBreakpointTreeController.prototype._reset):
* UserInterface/Main.html:
New files.
* UserInterface/Models/XHRBreakpoint.js: Added.
New model class. XHR breakpoints have an associated URL, which is matched
against the request URL when deciding whether to break. An empty URL matches
all XMLHttpRequests.
(WebInspector.XHRBreakpoint):
(WebInspector.XHRBreakpoint.prototype.get documentURL):
(WebInspector.XHRBreakpoint.prototype.get url):
(WebInspector.XHRBreakpoint.prototype.get disabled):
(WebInspector.XHRBreakpoint.prototype.set disabled):
(WebInspector.XHRBreakpoint.prototype.get serializableInfo):
(WebInspector.XHRBreakpoint.prototype.saveIdentityToCookie):
* UserInterface/Test.html:
New files.
* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
Plumbing for new represented object type, to prevent runtime assertion.
* UserInterface/Views/DOMBreakpointTreeElement.js:
(WebInspector.DOMBreakpointTreeElement):
Reuse BreakpointTreeElement styles.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
(WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
(WebInspector.DebuggerSidebarPanel.prototype._addXHRBreakpointButtonClicked):
(WebInspector.DebuggerSidebarPanel.prototype.willDismissPopover):
* UserInterface/Views/InputPopover.css: Added.
(.popover .input-popover-content):
(.popover .input-popover-content > .editor):
(.popover .input-popover-content > .editor > .CodeMirror):
(.popover .input-popover-content > .editor > .CodeMirror-scroll):
* UserInterface/Views/InputPopover.js: Added.
New general purpose popover class. Style and structure lifted from
the Popover implementation used by the Probe Expressions UI. A follow-up
has been filed to switch that UI over to this new class:
https://bugs.webkit.org/show_bug.cgi?id=169428.
(WebInspector.InputPopover):
(WebInspector.InputPopover.prototype.get value):
(WebInspector.InputPopover.prototype.get result):
(WebInspector.InputPopover.prototype.show):
(WebInspector.InputPopover.prototype._presentOverTargetElement):
* UserInterface/Views/XHRBreakpointTreeElement.js: Added.
Tree element class for XHR breakpoints. Behaves identically to
script and DOM breakpoint tree elements.
(WebInspector.XHRBreakpointTreeElement):
Reuse BreakpointTreeElement styles.
(WebInspector.XHRBreakpointTreeElement.prototype.onattach):
(WebInspector.XHRBreakpointTreeElement.prototype.ondetach):
(WebInspector.XHRBreakpointTreeElement.prototype.ondelete):
(WebInspector.XHRBreakpointTreeElement.prototype.onenter):
(WebInspector.XHRBreakpointTreeElement.prototype.onspace):
(WebInspector.XHRBreakpointTreeElement.prototype.populateContextMenu):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementClicked):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementFocused):
(WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementMouseDown):
(WebInspector.XHRBreakpointTreeElement.prototype._toggleBreakpoint):
(WebInspector.XHRBreakpointTreeElement.prototype._updateStatus):
LayoutTests:
Tests for pausing on XMLHttpRequests using XHR breakpoints.
* inspector/dom-debugger/xhr-breakpoints-expected.txt: Added.
* inspector/dom-debugger/xhr-breakpoints.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolDOMDebuggerjson">trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMDebuggerAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDOMDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceMainhtml">trunk/Source/WebInspectorUI/UserInterface/Main.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceTesthtml">trunk/Source/WebInspectorUI/UserInterface/Test.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsContentViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPanelcss">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordomdebuggerxhrbreakpointsexpectedtxt">trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomdebuggerxhrbreakpointshtml">trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints.html</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersXHRBreakpointTreeControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsXHRBreakpointjs">trunk/Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsInputPopovercss">trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsInputPopoverjs">trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsXHRBreakpointTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementcss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/LayoutTests/ChangeLog        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-03-09 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Add XHR breakpoints UI
+ https://bugs.webkit.org/show_bug.cgi?id=168763
+ <rdar://problem/30952439>
+
+ Reviewed by Joseph Pecoraro.
+
+ Tests for pausing on XMLHttpRequests using XHR breakpoints.
+
+ * inspector/dom-debugger/xhr-breakpoints-expected.txt: Added.
+ * inspector/dom-debugger/xhr-breakpoints.html: Added.
+
</ins><span class="cx"> 2017-03-09 John Wilander <wilander@apple.com>
</span><span class="cx">
</span><span class="cx"> Resource Load Statistics: Remove statistics data as part of full website data removal
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomdebuggerxhrbreakpointsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints-expected.txt (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints-expected.txt         (rev 0)
+++ trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints-expected.txt        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+Tests for XHR breakpoints.
+
+
+== Running test suite: XHRBreakpoints
+-- Running test case: BreakOnAllXMLHttpRequests
+Set pause on all XMLHttpRequests.
+Sending XMLHttpRequest.
+PAUSED:
+PASS: Pause reason should be XHR.
+PASS: Pause data URL should be empty.
+CALL STACK:
+0: [F] loadResourceXHR
+1: [P] Global Code
+-- Running test teardown.
+
+-- Running test case: BreakOnXMLHttpRequestContainingURL
+PASS: Breakpoint should not be disabled initially.
+PASS: Added breakpoint for URL: data
+Sending XMLHttpRequest.
+PAUSED:
+PASS: Pause reason should be XHR.
+PASS: Pause data URL should match breakpoint URL.
+CALL STACK:
+0: [F] loadResourceXHR
+1: [P] Global Code
+-- Running test teardown.
+
+-- Running test case: ShouldNotPauseOnDisabledBreakpoint
+PASS: Breakpoint should not be disabled initially.
+Disabling breakpoint.
+PASS: Added breakpoint for URL: data
+Sending XMLHttpRequest.
+Wait for evaluate in page to return.
+PASS: Should not pause for disabled breakpoint.
+-- Running test teardown.
+
+-- Running test case: ShouldNotPauseOnXMLHttpRequestNotContainingURL
+PASS: Breakpoint should not be disabled initially.
+PASS: Added breakpoint for URL: nonexistant-url
+Sending XMLHttpRequest.
+Wait for evaluate in page to return.
+PASS: Should not pause for breakpoint with different URL.
+-- Running test teardown.
+
+-- Running test case: RemoveBreakpoint
+PASS: Breakpoint should not be disabled initially.
+PASS: Added breakpoint for URL: data
+Remove breakpoint.
+Wait for evaluate in page to return.
+PASS: Should not pause for removed breakpoint.
+-- Running test teardown.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomdebuggerxhrbreakpointshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints.html (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints.html         (rev 0)
+++ trunk/LayoutTests/inspector/dom-debugger/xhr-breakpoints.html        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,189 @@
</span><ins>+<!doctype html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="../debugger/resources/log-active-stack-trace.js"></script>
+<script src="../worker/resources/resource-utilities.js"></script>
+<script>
+function test()
+{
+ let suite = InspectorTest.createAsyncSuite("XHRBreakpoints");
+
+ function teardown(resolve) {
+ let breakpoints = WebInspector.domDebuggerManager.xhrBreakpoints;
+ for (let breakpoint of breakpoints)
+ WebInspector.domDebuggerManager.removeXHRBreakpoint(breakpoint);
+
+ WebInspector.domDebuggerManager.allRequestsBreakpoint.disabled = true;
+ resolve();
+ }
+
+ function awaitEvaluateInPage(expression) {
+ return new Promise((resolve, reject) => {
+ InspectorTest.log("Wait for evaluate in page to return.");
+ InspectorTest.evaluateInPage(expression, (error) => {
+ if (error)
+ reject(error);
+
+ resolve();
+ });
+ });
+ }
+
+ function rejectOnPause() {
+ return new Promise((resolve, reject) => {
+ WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Paused)
+ .then((event) => {
+ WebInspector.debuggerManager.resume();
+ InspectorTest.fail("Should not pause.");
+ reject();
+ });
+ });
+ }
+
+ function addBreakpointForURL(url, disabled) {
+ return new Promise((resolve, reject) => {
+ let mainFrame = WebInspector.frameResourceManager.mainFrame;
+ InspectorTest.assert(mainFrame, "Missing main frame.");
+ if (!mainFrame)
+ reject();
+
+ let breakpoint = new WebInspector.XHRBreakpoint(mainFrame.url, url);
+ WebInspector.domDebuggerManager.awaitEvent(WebInspector.DOMDebuggerManager.Event.XHRBreakpointAdded)
+ .then(() => {
+ InspectorTest.expectFalse(breakpoint.disabled, "Breakpoint should not be disabled initially.");
+
+ if (disabled) {
+ InspectorTest.log("Disabling breakpoint.");
+ breakpoint.disabled = true;
+ }
+
+ InspectorTest.pass("Added breakpoint for URL: " + url);
+ resolve(breakpoint);
+ });
+
+ WebInspector.domDebuggerManager.addXHRBreakpoint(breakpoint);
+ });
+ }
+
+ suite.addTestCase({
+ name: "BreakOnAllXMLHttpRequests",
+ description: "Check that debugger pauses for all XMLHttpRequests.",
+ teardown,
+ test(resolve, reject) {
+ InspectorTest.log("Set pause on all XMLHttpRequests.");
+ WebInspector.domDebuggerManager.allRequestsBreakpoint.disabled = false;
+
+ InspectorTest.log("Sending XMLHttpRequest.");
+ InspectorTest.evaluateInPage("loadResourceXHR()");
+
+ WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Paused)
+ .then(() => {
+ let targetData = WebInspector.debuggerManager.dataForTarget(WebInspector.debuggerManager.activeCallFrame.target);
+ InspectorTest.log("PAUSED:");
+ InspectorTest.expectEqual(targetData.pauseReason, WebInspector.DebuggerManager.PauseReason.XHR, "Pause reason should be XHR.");
+ InspectorTest.expectFalse(targetData.pauseData.breakpointURL, "Pause data URL should be empty.");
+
+ logActiveStackTrace();
+
+ return WebInspector.debuggerManager.resume();
+ })
+ .then(resolve, reject);
+ }
+ });
+
+ suite.addTestCase({
+ name: "BreakOnXMLHttpRequestContainingURL",
+ description: "Check that debugger pauses for XMLHttpRequests.",
+ teardown,
+ test(resolve, reject) {
+ let expectedBreakpointURL;
+ addBreakpointForURL("data")
+ .then((breakpoint) => {
+ expectedBreakpointURL = breakpoint.url;
+
+ InspectorTest.log("Sending XMLHttpRequest.");
+ InspectorTest.evaluateInPage("loadResourceXHR()");
+ return WebInspector.debuggerManager.awaitEvent(WebInspector.DebuggerManager.Event.Paused);
+ })
+ .then(() => {
+ let targetData = WebInspector.debuggerManager.dataForTarget(WebInspector.debuggerManager.activeCallFrame.target);
+ InspectorTest.log("PAUSED:");
+ InspectorTest.expectEqual(targetData.pauseReason, WebInspector.DebuggerManager.PauseReason.XHR, "Pause reason should be XHR.");
+ InspectorTest.expectEqual(targetData.pauseData.breakpointURL, expectedBreakpointURL, "Pause data URL should match breakpoint URL.");
+
+ logActiveStackTrace();
+
+ return WebInspector.debuggerManager.resume();
+ })
+ .then(resolve, reject);
+ }
+ });
+
+ suite.addTestCase({
+ name: "ShouldNotPauseOnDisabledBreakpoint",
+ description: "Check that debugger does not pause for disabled breakpoint.",
+ teardown,
+ test(resolve, reject) {
+ const disabled = true;
+ addBreakpointForURL("data", disabled)
+ .then((breakpoint) => {
+ InspectorTest.log("Sending XMLHttpRequest.");
+ return Promise.race([awaitEvaluateInPage("loadResourceXHR()"), rejectOnPause()]);
+ })
+ .then(() => {
+ InspectorTest.pass("Should not pause for disabled breakpoint.");
+ resolve();
+ })
+ .catch(reject);
+ }
+ });
+
+ suite.addTestCase({
+ name: "ShouldNotPauseOnXMLHttpRequestNotContainingURL",
+ description: "Check that debugger does not pause for breakpoint with different URL.",
+ teardown,
+ test(resolve, reject) {
+ addBreakpointForURL("nonexistant-url")
+ .then((breakpoint) => {
+ InspectorTest.log("Sending XMLHttpRequest.");
+ return Promise.race([awaitEvaluateInPage("loadResourceXHR()"), rejectOnPause()]);
+ })
+ .then(() => {
+ InspectorTest.pass("Should not pause for breakpoint with different URL.");
+ resolve();
+ })
+ .catch(reject);
+ }
+ });
+
+ suite.addTestCase({
+ name: "RemoveBreakpoint",
+ description: "Check that debugger does not pause for removed breakpoint.",
+ teardown,
+ test(resolve, reject) {
+ addBreakpointForURL("data")
+ .then((breakpoint) => {
+ let promise = WebInspector.domDebuggerManager.awaitEvent(WebInspector.DOMDebuggerManager.Event.XHRBreakpointRemoved);
+
+ InspectorTest.log("Remove breakpoint.");
+ WebInspector.domDebuggerManager.removeXHRBreakpoint(breakpoint);
+ return promise;
+ })
+ .then(() => Promise.race([awaitEvaluateInPage("loadResourceXHR()"), rejectOnPause()]))
+ .then(() => {
+ InspectorTest.pass("Should not pause for removed breakpoint.");
+ resolve();
+ })
+ .catch(reject);
+ }
+ });
+
+ suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Tests for XHR breakpoints.</p>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/JavaScriptCore/ChangeLog        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-03-09 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Add XHR breakpoints UI
+ https://bugs.webkit.org/show_bug.cgi?id=168763
+ <rdar://problem/30952439>
+
+ Reviewed by Joseph Pecoraro.
+
+ * inspector/protocol/DOMDebugger.json:
+ Added clarifying comments to command descriptions.
+
</ins><span class="cx"> 2017-03-09 Michael Saboff <msaboff@apple.com>
</span><span class="cx">
</span><span class="cx"> Add plumbing to WebProcess to enable JavaScriptCore configuration and logging
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolDOMDebuggerjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/JavaScriptCore/inspector/protocol/DOMDebugger.json        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> {
</span><span class="cx"> "name": "setXHRBreakpoint",
</span><span class="cx"> "parameters": [
</span><del>- { "name": "url", "type": "string", "description": "Resource URL substring. All XHRs having this substring in the URL will get stopped upon." }
</del><ins>+ { "name": "url", "type": "string", "description": "Resource URL substring. All XHRs having this substring in the URL will get stopped upon. An empty string will pause on all XHRs." }
</ins><span class="cx"> ],
</span><span class="cx"> "description": "Sets breakpoint on XMLHttpRequest."
</span><span class="cx"> },
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> {
</span><span class="cx"> "name": "removeXHRBreakpoint",
</span><span class="cx"> "parameters": [
</span><del>- { "name": "url", "type": "string", "description": "Resource URL substring." }
</del><ins>+ { "name": "url", "type": "string", "description": "Resource URL substring. An empty string will stop pausing on all XHRs." }
</ins><span class="cx"> ],
</span><span class="cx"> "description": "Removes breakpoint from XMLHttpRequest."
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebCore/ChangeLog        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-03-09 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Add XHR breakpoints UI
+ https://bugs.webkit.org/show_bug.cgi?id=168763
+ <rdar://problem/30952439>
+
+ Reviewed by Joseph Pecoraro.
+
+ Test: inspector/dom-debugger/xhr-breakpoints.html
+
+ * inspector/InspectorDOMDebuggerAgent.cpp:
+ (WebCore::InspectorDOMDebuggerAgent::discardBindings):
+ (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
+ Don't break for XHRs when breakpoints are disabled.
+
</ins><span class="cx"> 2017-03-09 Michael Saboff <msaboff@apple.com>
</span><span class="cx">
</span><span class="cx"> Add plumbing to WebProcess to enable JavaScriptCore configuration and logging
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -114,6 +114,7 @@
</span><span class="cx"> void InspectorDOMDebuggerAgent::discardBindings()
</span><span class="cx"> {
</span><span class="cx"> m_domBreakpoints.clear();
</span><ins>+ m_xhrBreakpoints.clear();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorDOMDebuggerAgent::setEventListenerBreakpoint(ErrorString& error, const String& eventName)
</span><span class="lines">@@ -393,6 +394,9 @@
</span><span class="cx">
</span><span class="cx"> void InspectorDOMDebuggerAgent::willSendXMLHttpRequest(const String& url)
</span><span class="cx"> {
</span><ins>+ if (!m_debuggerAgent->breakpointsActive())
+ return;
+
</ins><span class="cx"> String breakpointURL;
</span><span class="cx"> if (m_pauseOnAllXHRsEnabled)
</span><span class="cx"> breakpointURL = emptyString();
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/ChangeLog        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,5 +1,127 @@
</span><span class="cx"> 2017-03-09 Matt Baker <mattbaker@apple.com>
</span><span class="cx">
</span><ins>+ Web Inspector: Add XHR breakpoints UI
+ https://bugs.webkit.org/show_bug.cgi?id=168763
+ <rdar://problem/30952439>
+
+ Reviewed by Joseph Pecoraro.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ New UI strings.
+
+ * UserInterface/Controllers/DOMDebuggerManager.js:
+ Plumbing for XHR breakpoints. Like DOM breakpoints, they are tracked
+ per-page. Unlike DOM breakpoints, they have no separate "resolved"
+ state, and are simply added/removed as the main frame changes.
+
+ (WebInspector.DOMDebuggerManager):
+ (WebInspector.DOMDebuggerManager.prototype.get allRequestsBreakpoint):
+ (WebInspector.DOMDebuggerManager.prototype.get xhrBreakpoints):
+ (WebInspector.DOMDebuggerManager.prototype.isBreakpointRemovable):
+ (WebInspector.DOMDebuggerManager.prototype.removeDOMBreakpoint):
+ (WebInspector.DOMDebuggerManager.prototype.addXHRBreakpoint):
+ (WebInspector.DOMDebuggerManager.prototype.removeXHRBreakpoint):
+ (WebInspector.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints):
+ (WebInspector.DOMDebuggerManager.prototype._detachXHRBreakpoint):
+ (WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint.breakpointUpdated):
+ (WebInspector.DOMDebuggerManager.prototype._updateXHRBreakpoint):
+ (WebInspector.DOMDebuggerManager.prototype._resolveXHRBreakpoint):
+ (WebInspector.DOMDebuggerManager.prototype._saveXHRBreakpoints):
+ (WebInspector.DOMDebuggerManager.prototype._domBreakpointDisabledStateDidChange):
+ (WebInspector.DOMDebuggerManager.prototype._xhrBreakpointDisabledStateDidChange):
+ (WebInspector.DOMDebuggerManager.prototype._mainResourceDidChange):
+ (WebInspector.DOMDebuggerManager.prototype._saveBreakpoints): Deleted.
+ Renamed `saveDOMBreakpoints`.
+
+ * UserInterface/Controllers/DebuggerManager.js:
+ (WebInspector.DebuggerManager.prototype._pauseReasonFromPayload):
+ Plumbing for XHR breakpoint pause reason.
+
+ * UserInterface/Controllers/XHRBreakpointTreeController.js: Added.
+ Creates the "All Requests" breakpoint, handles DOMDebuggerManager messages,
+ and updates an associated tree outline as XHR breakpoints are added and removed.
+
+ (WebInspector.XHRBreakpointTreeController):
+ (WebInspector.XHRBreakpointTreeController.prototype.revealAndSelect):
+ (WebInspector.XHRBreakpointTreeController.prototype.disconnect):
+ (WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointAdded):
+ (WebInspector.XHRBreakpointTreeController.prototype._xhrBreakpointRemoved):
+ (WebInspector.XHRBreakpointTreeController.prototype._mainResourceDidChange):
+ (WebInspector.XHRBreakpointTreeController.prototype._reset):
+
+ * UserInterface/Main.html:
+ New files.
+
+ * UserInterface/Models/XHRBreakpoint.js: Added.
+ New model class. XHR breakpoints have an associated URL, which is matched
+ against the request URL when deciding whether to break. An empty URL matches
+ all XMLHttpRequests.
+
+ (WebInspector.XHRBreakpoint):
+ (WebInspector.XHRBreakpoint.prototype.get documentURL):
+ (WebInspector.XHRBreakpoint.prototype.get url):
+ (WebInspector.XHRBreakpoint.prototype.get disabled):
+ (WebInspector.XHRBreakpoint.prototype.set disabled):
+ (WebInspector.XHRBreakpoint.prototype.get serializableInfo):
+ (WebInspector.XHRBreakpoint.prototype.saveIdentityToCookie):
+
+ * UserInterface/Test.html:
+ New files.
+
+ * UserInterface/Views/ContentView.js:
+ (WebInspector.ContentView.createFromRepresentedObject):
+ Plumbing for new represented object type, to prevent runtime assertion.
+
+ * UserInterface/Views/DOMBreakpointTreeElement.js:
+ (WebInspector.DOMBreakpointTreeElement):
+ Reuse BreakpointTreeElement styles.
+
+ * UserInterface/Views/DebuggerSidebarPanel.js:
+ (WebInspector.DebuggerSidebarPanel):
+ (WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
+ (WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
+ (WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):
+ (WebInspector.DebuggerSidebarPanel.prototype._addXHRBreakpointButtonClicked):
+ (WebInspector.DebuggerSidebarPanel.prototype.willDismissPopover):
+
+ * UserInterface/Views/InputPopover.css: Added.
+ (.popover .input-popover-content):
+ (.popover .input-popover-content > .editor):
+ (.popover .input-popover-content > .editor > .CodeMirror):
+ (.popover .input-popover-content > .editor > .CodeMirror-scroll):
+
+ * UserInterface/Views/InputPopover.js: Added.
+ New general purpose popover class. Style and structure lifted from
+ the Popover implementation used by the Probe Expressions UI. A follow-up
+ has been filed to switch that UI over to this new class:
+ https://bugs.webkit.org/show_bug.cgi?id=169428.
+
+ (WebInspector.InputPopover):
+ (WebInspector.InputPopover.prototype.get value):
+ (WebInspector.InputPopover.prototype.get result):
+ (WebInspector.InputPopover.prototype.show):
+ (WebInspector.InputPopover.prototype._presentOverTargetElement):
+
+ * UserInterface/Views/XHRBreakpointTreeElement.js: Added.
+ Tree element class for XHR breakpoints. Behaves identically to
+ script and DOM breakpoint tree elements.
+
+ (WebInspector.XHRBreakpointTreeElement):
+ Reuse BreakpointTreeElement styles.
+ (WebInspector.XHRBreakpointTreeElement.prototype.onattach):
+ (WebInspector.XHRBreakpointTreeElement.prototype.ondetach):
+ (WebInspector.XHRBreakpointTreeElement.prototype.ondelete):
+ (WebInspector.XHRBreakpointTreeElement.prototype.onenter):
+ (WebInspector.XHRBreakpointTreeElement.prototype.onspace):
+ (WebInspector.XHRBreakpointTreeElement.prototype.populateContextMenu):
+ (WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementClicked):
+ (WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementFocused):
+ (WebInspector.XHRBreakpointTreeElement.prototype._statusImageElementMouseDown):
+ (WebInspector.XHRBreakpointTreeElement.prototype._toggleBreakpoint):
+ (WebInspector.XHRBreakpointTreeElement.prototype._updateStatus):
+
+2017-03-09 Matt Baker <mattbaker@apple.com>
+
</ins><span class="cx"> REGRESSION (r196271): Web Inspector: DOM element loses focus/active selection after committing an inline attribute editor in DOMTreeOutline
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=168119
</span><span class="cx"> <rdar://problem/30466013>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx"> localizedStrings["Add New"] = "Add New";
</span><span class="cx"> localizedStrings["Add New Probe Expression"] = "Add New Probe Expression";
</span><span class="cx"> localizedStrings["Add New Watch Expression"] = "Add New Watch Expression";
</span><ins>+localizedStrings["Add XHR Breakpoint"] = "Add XHR Breakpoint";
</ins><span class="cx"> localizedStrings["Add a Class"] = "Add a Class";
</span><span class="cx"> localizedStrings["Add new breakpoint action after this action"] = "Add new breakpoint action after this action";
</span><span class="cx"> localizedStrings["Add new rule"] = "Add new rule";
</span><span class="lines">@@ -75,6 +76,7 @@
</span><span class="cx"> localizedStrings["All"] = "All";
</span><span class="cx"> localizedStrings["All Changes"] = "All Changes";
</span><span class="cx"> localizedStrings["All Exceptions"] = "All Exceptions";
</span><ins>+localizedStrings["All Requests"] = "All Requests";
</ins><span class="cx"> localizedStrings["All Resources"] = "All Resources";
</span><span class="cx"> localizedStrings["All Storage"] = "All Storage";
</span><span class="cx"> localizedStrings["Alternates"] = "Alternates";
</span><span class="lines">@@ -124,6 +126,7 @@
</span><span class="cx"> localizedStrings["Box Model"] = "Box Model";
</span><span class="cx"> localizedStrings["Box Shadow"] = "Box Shadow";
</span><span class="cx"> localizedStrings["Break on…"] = "Break on…";
</span><ins>+localizedStrings["Break when URL contains:"] = "Break when URL contains:";
</ins><span class="cx"> localizedStrings["Breakdown"] = "Breakdown";
</span><span class="cx"> localizedStrings["Breakdown of each memory category at the end of the selected time range"] = "Breakdown of each memory category at the end of the selected time range";
</span><span class="cx"> localizedStrings["Breakpoints"] = "Breakpoints";
</span><span class="lines">@@ -834,10 +837,12 @@
</span><span class="cx"> localizedStrings["Transition"] = "Transition";
</span><span class="cx"> localizedStrings["Triggered Breakpoint"] = "Triggered Breakpoint";
</span><span class="cx"> localizedStrings["Triggered DOM Breakpoint"] = "Triggered DOM Breakpoint";
</span><ins>+localizedStrings["Triggered XHR Breakpoint"] = "Triggered XHR Breakpoint";
</ins><span class="cx"> localizedStrings["True"] = "True";
</span><span class="cx"> localizedStrings["Type"] = "Type";
</span><span class="cx"> localizedStrings["Type Issue"] = "Type Issue";
</span><span class="cx"> localizedStrings["Type information for variable: %s"] = "Type information for variable: %s";
</span><ins>+localizedStrings["URL contains:"] = "URL contains:";
</ins><span class="cx"> localizedStrings["Unable to determine path to property from root"] = "Unable to determine path to property from root";
</span><span class="cx"> localizedStrings["Uncaught Exceptions"] = "Uncaught Exceptions";
</span><span class="cx"> localizedStrings["Unchanged"] = "Unchanged";
</span><span class="lines">@@ -881,6 +886,7 @@
</span><span class="cx"> localizedStrings["X1"] = "X1";
</span><span class="cx"> localizedStrings["X2"] = "X2";
</span><span class="cx"> localizedStrings["XHR"] = "XHR";
</span><ins>+localizedStrings["XHR Breakpoints"] = "XHR Breakpoints";
</ins><span class="cx"> localizedStrings["XHRs"] = "XHRs";
</span><span class="cx"> localizedStrings["Y"] = "Y";
</span><span class="cx"> localizedStrings["Y1"] = "Y1";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDOMDebuggerManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -33,7 +33,15 @@
</span><span class="cx"> this._domBreakpointURLMap = new Map;
</span><span class="cx"> this._domBreakpointFrameIdentifierMap = new Map;
</span><span class="cx">
</span><ins>+ this._xhrBreakpointsSetting = new WebInspector.Setting("xhr-breakpoints", []);
+ this._xhrBreakpointURLMap = new Map;
+ this._allRequestsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-requests", false);
+
+ const emptyURL = "";
+ this._allRequestsBreakpoint = new WebInspector.XHRBreakpoint(null, emptyURL, !this._allRequestsBreakpointEnabledSetting.value);
+
</ins><span class="cx"> WebInspector.DOMBreakpoint.addEventListener(WebInspector.DOMBreakpoint.Event.DisabledStateDidChange, this._domBreakpointDisabledStateDidChange, this);
</span><ins>+ WebInspector.XHRBreakpoint.addEventListener(WebInspector.XHRBreakpoint.Event.DisabledStateDidChange, this._xhrBreakpointDisabledStateDidChange, this);
</ins><span class="cx">
</span><span class="cx"> WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeRemoved, this._nodeRemoved, this);
</span><span class="cx"> WebInspector.domTreeManager.addEventListener(WebInspector.DOMTreeManager.Event.NodeInserted, this._nodeInserted, this);
</span><span class="lines">@@ -51,6 +59,11 @@
</span><span class="cx"> this.addDOMBreakpoint(breakpoint);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ for (let cookie of this._xhrBreakpointsSetting.value) {
+ let breakpoint = new WebInspector.XHRBreakpoint(cookie.documentURL, cookie.url, cookie.disabled);
+ this.addXHRBreakpoint(breakpoint);
+ }
+
</ins><span class="cx"> this._restoringBreakpoints = false;
</span><span class="cx"> this._speculativelyResolveBreakpoints();
</span><span class="cx"> }
</span><span class="lines">@@ -63,6 +76,8 @@
</span><span class="cx"> return !!window.DOMDebuggerAgent;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ get allRequestsBreakpoint() { return this._allRequestsBreakpoint; }
+
</ins><span class="cx"> get domBreakpoints()
</span><span class="cx"> {
</span><span class="cx"> let mainFrame = WebInspector.frameResourceManager.mainFrame;
</span><span class="lines">@@ -85,6 +100,24 @@
</span><span class="cx"> return resolvedBreakpoints;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ get xhrBreakpoints()
+ {
+ let mainFrame = WebInspector.frameResourceManager.mainFrame;
+ if (!mainFrame)
+ return [];
+
+ let breakpoints = this._xhrBreakpointURLMap.get(mainFrame.url)
+ if (!breakpoints)
+ return [];
+
+ return breakpoints.slice();
+ }
+
+ isBreakpointRemovable(breakpoint)
+ {
+ return breakpoint !== this._allRequestsBreakpoint;
+ }
+
</ins><span class="cx"> domBreakpointsForNode(node)
</span><span class="cx"> {
</span><span class="cx"> console.assert(node instanceof WebInspector.DOMNode);
</span><span class="lines">@@ -148,9 +181,47 @@
</span><span class="cx">
</span><span class="cx"> breakpoint.domNodeIdentifier = null;
</span><span class="cx">
</span><del>- this._saveBreakpoints();
</del><ins>+ this._saveDOMBreakpoints();
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ addXHRBreakpoint(breakpoint)
+ {
+ console.assert(breakpoint instanceof WebInspector.XHRBreakpoint);
+ if (!breakpoint || !breakpoint.documentURL)
+ return;
+
+ let url = breakpoint.documentURL;
+ let breakpoints = this._xhrBreakpointURLMap.get(url);
+ if (!breakpoints) {
+ breakpoints = [breakpoint];
+ this._xhrBreakpointURLMap.set(url, breakpoints);
+ } else
+ breakpoints.push(breakpoint);
+
+ this._resolveXHRBreakpoint(breakpoint);
+ this._saveXHRBreakpoints();
+ }
+
+ removeXHRBreakpoint(breakpoint)
+ {
+ console.assert(breakpoint instanceof WebInspector.XHRBreakpoint);
+ if (!breakpoint)
+ return;
+
+ let url = breakpoint.documentURL;
+ let breakpoints = this._xhrBreakpointURLMap.get(url);
+ breakpoints.remove(breakpoint, true);
+
+ this._detachXHRBreakpoint(breakpoint);
+
+ if (!breakpoints.length)
+ this._xhrBreakpointURLMap.delete(url);
+
+ this.dispatchEventToListeners(WebInspector.DOMDebuggerManager.Event.DOMBreakpointRemoved, {breakpoint});
+
+ this._saveXHRBreakpoints();
+ }
+
</ins><span class="cx"> // Private
</span><span class="cx">
</span><span class="cx"> _detachDOMBreakpoint(breakpoint)
</span><span class="lines">@@ -203,20 +274,25 @@
</span><span class="cx"> if (!mainFrame)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- let breakpoints = this._domBreakpointURLMap.get(mainFrame.url);
- if (!breakpoints)
- return;
</del><ins>+ let domBreakpoints = this._domBreakpointURLMap.get(mainFrame.url);
+ if (domBreakpoints) {
+ for (let breakpoint of domBreakpoints) {
+ if (breakpoint.domNodeIdentifier)
+ continue;
</ins><span class="cx">
</span><del>- for (let breakpoint of breakpoints) {
- if (breakpoint.domNodeIdentifier)
- continue;
</del><ins>+ WebInspector.domTreeManager.pushNodeByPathToFrontend(breakpoint.path, (nodeIdentifier) => {
+ if (!nodeIdentifier)
+ return;
</ins><span class="cx">
</span><del>- WebInspector.domTreeManager.pushNodeByPathToFrontend(breakpoint.path, (nodeIdentifier) => {
- if (!nodeIdentifier)
- return;
</del><ins>+ this._resolveDOMBreakpoint(breakpoint, nodeIdentifier);
+ });
+ }
+ }
</ins><span class="cx">
</span><del>- this._resolveDOMBreakpoint(breakpoint, nodeIdentifier);
- });
</del><ins>+ let xhrBreakpoints = this._xhrBreakpointURLMap.get(mainFrame.url);
+ if (xhrBreakpoints) {
+ for (let breakpoint of xhrBreakpoints)
+ this._resolveXHRBreakpoint(breakpoint);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -263,8 +339,48 @@
</span><span class="cx"> DOMDebuggerAgent.setDOMBreakpoint(nodeIdentifier, breakpoint.type, breakpointUpdated);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- _saveBreakpoints()
</del><ins>+ _detachXHRBreakpoint(breakpoint)
</ins><span class="cx"> {
</span><ins>+ if (breakpoint.disabled)
+ return;
+
+ DOMDebuggerAgent.removeXHRBreakpoint(breakpoint.url, (error) => {
+ if (error)
+ console.error(error);
+
+ this.dispatchEventToListeners(WebInspector.DOMDebuggerManager.Event.XHRBreakpointRemoved, {breakpoint});
+ });
+ }
+
+ _updateXHRBreakpoint(breakpoint, callback)
+ {
+ function breakpointUpdated(error)
+ {
+ if (error)
+ console.error(error);
+
+ if (callback && typeof callback === "function")
+ callback(error);
+ }
+
+ if (breakpoint.disabled)
+ DOMDebuggerAgent.removeXHRBreakpoint(breakpoint.url, breakpointUpdated);
+ else
+ DOMDebuggerAgent.setXHRBreakpoint(breakpoint.url, breakpointUpdated);
+ }
+
+ _resolveXHRBreakpoint(breakpoint)
+ {
+ if (breakpoint.disabled)
+ return;
+
+ this._updateXHRBreakpoint(breakpoint, () => {
+ this.dispatchEventToListeners(WebInspector.DOMDebuggerManager.Event.XHRBreakpointAdded, {breakpoint});
+ });
+ }
+
+ _saveDOMBreakpoints()
+ {
</ins><span class="cx"> if (this._restoringBreakpoints)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -275,13 +391,36 @@
</span><span class="cx"> this._domBreakpointsSetting.value = breakpointsToSave.map((breakpoint) => breakpoint.serializableInfo);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ _saveXHRBreakpoints()
+ {
+ if (this._restoringBreakpoints)
+ return;
+
+ let breakpointsToSave = [];
+ for (let breakpoints of this._xhrBreakpointURLMap.values())
+ breakpointsToSave = breakpointsToSave.concat(breakpoints);
+
+ this._xhrBreakpointsSetting.value = breakpointsToSave.map((breakpoint) => breakpoint.serializableInfo);
+ }
+
</ins><span class="cx"> _domBreakpointDisabledStateDidChange(event)
</span><span class="cx"> {
</span><span class="cx"> let breakpoint = event.target;
</span><span class="cx"> this._updateDOMBreakpoint(breakpoint);
</span><del>- this._saveBreakpoints();
</del><ins>+ this._saveDOMBreakpoints();
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ _xhrBreakpointDisabledStateDidChange(event)
+ {
+ let breakpoint = event.target;
+
+ if (breakpoint === this._allRequestsBreakpoint)
+ this._allRequestsBreakpointEnabledSetting.value = !breakpoint.disabled;
+
+ this._updateXHRBreakpoint(breakpoint);
+ this._saveXHRBreakpoints();
+ }
+
</ins><span class="cx"> _childFrameWasRemoved(event)
</span><span class="cx"> {
</span><span class="cx"> let frame = event.data.childFrame;
</span><span class="lines">@@ -301,6 +440,12 @@
</span><span class="cx"> breakpoints.forEach((breakpoint) => { breakpoint.domNodeIdentifier = null; });
</span><span class="cx">
</span><span class="cx"> this._domBreakpointFrameIdentifierMap.clear();
</span><ins>+
+ let xhrBreakpoints = this._xhrBreakpointURLMap.get(frame.url);
+ if (xhrBreakpoints) {
+ for (let breakpoint of xhrBreakpoints)
+ this._detachXHRBreakpoint(breakpoint);
+ }
</ins><span class="cx"> } else
</span><span class="cx"> this._detachBreakpointsForFrame(frame);
</span><span class="cx">
</span><span class="lines">@@ -356,4 +501,6 @@
</span><span class="cx"> WebInspector.DOMDebuggerManager.Event = {
</span><span class="cx"> DOMBreakpointAdded: "dom-debugger-manager-dom-breakpoint-added",
</span><span class="cx"> DOMBreakpointRemoved: "dom-debugger-manager-dom-breakpoint-removed",
</span><ins>+ XHRBreakpointAdded: "dom-debugger-manager-xhr-breakpoint-added",
+ XHRBreakpointRemoved: "dom-debugger-manager-xhr-breakpoint-removed",
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -815,6 +815,8 @@
</span><span class="cx"> return WebInspector.DebuggerManager.PauseReason.Exception;
</span><span class="cx"> case DebuggerAgent.PausedReason.PauseOnNextStatement:
</span><span class="cx"> return WebInspector.DebuggerManager.PauseReason.PauseOnNextStatement;
</span><ins>+ case DebuggerAgent.PausedReason.XHR:
+ return WebInspector.DebuggerManager.PauseReason.XHR;
</ins><span class="cx"> default:
</span><span class="cx"> return WebInspector.DebuggerManager.PauseReason.Other;
</span><span class="cx"> }
</span><span class="lines">@@ -1228,5 +1230,6 @@
</span><span class="cx"> DOM: "DOM",
</span><span class="cx"> Exception: "exception",
</span><span class="cx"> PauseOnNextStatement: "pause-on-next-statement",
</span><ins>+ XHR: "xhr",
</ins><span class="cx"> Other: "other",
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersXHRBreakpointTreeControllerjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/XHRBreakpointTreeController.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.XHRBreakpointTreeController = class XHRBreakpointsTreeController extends WebInspector.Object
+{
+ constructor(treeOutline)
+ {
+ super();
+
+ this._treeOutline = treeOutline;
+
+ WebInspector.Frame.addEventListener(WebInspector.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+
+ WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.XHRBreakpointAdded, this._xhrBreakpointAdded, this);
+ WebInspector.domDebuggerManager.addEventListener(WebInspector.DOMDebuggerManager.Event.XHRBreakpointRemoved, this._xhrBreakpointRemoved, this);
+
+ this._allReqestsBreakpointTreeElement = new WebInspector.XHRBreakpointTreeElement(WebInspector.domDebuggerManager.allRequestsBreakpoint, WebInspector.DebuggerSidebarPanel.AssertionIconStyleClassName, WebInspector.UIString("All Requests"));
+
+ this._treeOutline.appendChild(this._allReqestsBreakpointTreeElement);
+ }
+
+ // Public
+
+ revealAndSelect(breakpoint)
+ {
+ let treeElement = this._treeOutline.findTreeElement(breakpoint);
+ if (!treeElement)
+ return;
+
+ treeElement.revealAndSelect();
+ }
+
+ disconnect()
+ {
+ WebInspector.Frame.removeEventListener(null, null, this);
+ WebInspector.domDebuggerManager.removeEventListener(null, null, this);
+ }
+
+ // Private
+
+ _xhrBreakpointAdded(event)
+ {
+ let breakpoint = event.data.breakpoint;
+ let treeElement = this._treeOutline.findTreeElement(breakpoint);
+ console.assert(!treeElement);
+ if (treeElement)
+ return;
+
+ this._treeOutline.appendChild(new WebInspector.XHRBreakpointTreeElement(breakpoint));
+ }
+
+ _xhrBreakpointRemoved(event)
+ {
+ let breakpoint = event.data.breakpoint;
+ let treeElement = this._treeOutline.findTreeElement(breakpoint);
+ if (!treeElement)
+ return;
+
+ this._treeOutline.removeChild(treeElement);
+ }
+
+ _mainResourceDidChange(event)
+ {
+ if (!event.target.isMainFrame())
+ return;
+
+ while (this._treeOutline.children.length > 1)
+ this._treeOutline.removeChild(this._treeOutline.children.lastValue);
+ }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceMainhtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Main.html        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -64,7 +64,6 @@
</span><span class="cx"> <link rel="stylesheet" href="Views/ControlToolbarItem.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/CookieIcon.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/CookieStorageContentView.css">
</span><del>- <link rel="stylesheet" href="Views/DOMBreakpointTreeElement.css">
</del><span class="cx"> <link rel="stylesheet" href="Views/DOMStorageContentView.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/DOMStorageIcons.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/DOMTreeContentView.css">
</span><span class="lines">@@ -103,6 +102,7 @@
</span><span class="cx"> <link rel="stylesheet" href="Views/IndeterminateProgressSpinner.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/IndexedDatabaseObjectStoreContentView.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/InlineSwatch.css">
</span><ins>+ <link rel="stylesheet" href="Views/InputPopover.css">
</ins><span class="cx"> <link rel="stylesheet" href="Views/IssueTreeElement.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/LayerTreeDetailsSidebarPanel.css">
</span><span class="cx"> <link rel="stylesheet" href="Views/LayoutTimelineOverviewGraph.css">
</span><span class="lines">@@ -402,6 +402,7 @@
</span><span class="cx"> <script src="Models/TypeSet.js"></script>
</span><span class="cx"> <script src="Models/WebSocketResource.js"></script>
</span><span class="cx"> <script src="Models/WrappedPromise.js"></script>
</span><ins>+ <script src="Models/XHRBreakpoint.js"></script>
</ins><span class="cx">
</span><span class="cx"> <script src="Proxies/FormatterWorkerProxy.js"></script>
</span><span class="cx"> <script src="Proxies/HeapSnapshotDiffProxy.js"></script>
</span><span class="lines">@@ -421,6 +422,7 @@
</span><span class="cx"> <script src="Views/Dialog.js"></script>
</span><span class="cx"> <script src="Views/HierarchicalPathComponent.js"></script>
</span><span class="cx"> <script src="Views/NavigationItem.js"></script>
</span><ins>+ <script src="Views/Popover.js"></script>
</ins><span class="cx"> <script src="Views/SidebarPanel.js"></script>
</span><span class="cx"> <script src="Views/StyleDetailsPanel.js"></script>
</span><span class="cx"> <script src="Views/TabBar.js"></script>
</span><span class="lines">@@ -582,6 +584,7 @@
</span><span class="cx"> <script src="Views/IndexedDatabaseObjectStoreTreeElement.js"></script>
</span><span class="cx"> <script src="Views/IndexedDatabaseTreeElement.js"></script>
</span><span class="cx"> <script src="Views/InlineSwatch.js"></script>
</span><ins>+ <script src="Views/InputPopover.js"></script>
</ins><span class="cx"> <script src="Views/IssueTreeElement.js"></script>
</span><span class="cx"> <script src="Views/LayerTreeDataGridNode.js"></script>
</span><span class="cx"> <script src="Views/LayerTreeDetailsSidebarPanel.js"></script>
</span><span class="lines">@@ -610,7 +613,6 @@
</span><span class="cx"> <script src="Views/ObjectTreeView.js"></script>
</span><span class="cx"> <script src="Views/OpenResourceDialog.js"></script>
</span><span class="cx"> <script src="Views/OverviewTimelineView.js"></script>
</span><del>- <script src="Views/Popover.js"></script>
</del><span class="cx"> <script src="Views/ProbeDetailsSidebarPanel.js"></script>
</span><span class="cx"> <script src="Views/ProbeSetDataGrid.js"></script>
</span><span class="cx"> <script src="Views/ProbeSetDataGridNode.js"></script>
</span><span class="lines">@@ -681,6 +683,7 @@
</span><span class="cx"> <script src="Views/TypeTreeView.js"></script>
</span><span class="cx"> <script src="Views/WebSocketContentView.js"></script>
</span><span class="cx"> <script src="Views/WorkerTreeElement.js"></script>
</span><ins>+ <script src="Views/XHRBreakpointTreeElement.js"></script>
</ins><span class="cx">
</span><span class="cx"> <script src="Views/VisualStyleDetailsPanel.js"></script>
</span><span class="cx"> <script src="Views/VisualStylePropertyEditor.js"></script>
</span><span class="lines">@@ -750,6 +753,7 @@
</span><span class="cx"> <script src="Controllers/TypeTokenAnnotator.js"></script>
</span><span class="cx"> <script src="Controllers/VisualStyleCompletionsController.js"></script>
</span><span class="cx"> <script src="Controllers/WorkerManager.js"></script>
</span><ins>+ <script src="Controllers/XHRBreakpointTreeController.js"></script>
</ins><span class="cx">
</span><span class="cx"> <script src="Workers/Formatter/FormatterContentBuilder.js"></script>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsXHRBreakpointjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/XHRBreakpoint.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.XHRBreakpoint = class XHRBreakpoint extends WebInspector.Object
+{
+ constructor(documentURL, url, disabled)
+ {
+ super();
+
+ this._documentURL = documentURL;
+ this._url = url;
+ this._disabled = disabled || false;
+ }
+
+ // Public
+
+ get documentURL() { return this._documentURL; }
+ get url() { return this._url; }
+
+ get disabled()
+ {
+ return this._disabled;
+ }
+
+ set disabled(disabled)
+ {
+ if (this._disabled === disabled)
+ return;
+
+ this._disabled = disabled;
+
+ this.dispatchEventToListeners(WebInspector.XHRBreakpoint.Event.DisabledStateDidChange);
+ }
+
+ get serializableInfo()
+ {
+ let info = {documentURL: this._documentURL, url: this._url};
+ if (this._disabled)
+ info.disabled = true;
+
+ return info;
+ }
+
+ saveIdentityToCookie(cookie)
+ {
+ cookie[WebInspector.XHRBreakpoint.DocumentURLCookieKey] = this._documentURL;
+ cookie[WebInspector.XHRBreakpoint.URLCookieKey] = this._url;
+ }
+};
+
+WebInspector.XHRBreakpoint.DocumentURLCookieKey = "xhr-breakpoint-document-url";
+WebInspector.XHRBreakpoint.URLCookieKey = "xhr-breakpoint-url";
+
+WebInspector.XHRBreakpoint.Event = {
+ DisabledStateDidChange: "xhr-breakpoint-disabled-state-did-change",
+ ResolvedStateDidChange: "xhr-breakpoint-resolved-state-did-change",
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceTesthtml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Test.html (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Test.html        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Test.html        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -174,6 +174,7 @@
</span><span class="cx"> <script src="Models/TimelineRecording.js"></script>
</span><span class="cx"> <script src="Models/WebSocketResource.js"></script>
</span><span class="cx"> <script src="Models/WrappedPromise.js"></script>
</span><ins>+ <script src="Models/XHRBreakpoint.js"></script>
</ins><span class="cx">
</span><span class="cx"> <script src="Proxies/FormatterWorkerProxy.js"></script>
</span><span class="cx"> <script src="Proxies/HeapSnapshotDiffProxy.js"></script>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsContentViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ContentView.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -126,6 +126,9 @@
</span><span class="cx"> return WebInspector.ContentView.createFromRepresentedObject(representedObject.domNode, extraArguments);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (representedObject instanceof WebInspector.XHRBreakpoint)
+ return WebInspector.ContentView.createFromRepresentedObject(WebInspector.frameResourceManager.mainFrame.domTree, extraArguments);
+
</ins><span class="cx"> if (representedObject instanceof WebInspector.SourceCodeSearchMatchObject) {
</span><span class="cx"> var resultView;
</span><span class="cx"> if (representedObject.sourceCode instanceof WebInspector.Resource)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementcss"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-.item.dom-breakpoint .icon {
- content: url(../Images/ResultLine.svg);
-}
-
-.item.dom-breakpoint.breakpoint-paused-icon .icon {
- content: url(../Images/PausedBreakpoint.svg);
-}
-
-.item.dom-breakpoint .status img {
- content: url(../Images/BreakpointButton.svg);
- width: 21px;
- height: 12px;
- margin-top: 3px;
-}
-
-.item.dom-breakpoint .status > img.disabled {
- opacity: 0.35;
-}
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -35,10 +35,10 @@
</span><span class="cx"> if (!title)
</span><span class="cx"> title = WebInspector.DOMBreakpointTreeElement.displayNameForType(breakpoint.type);
</span><span class="cx">
</span><del>- super(["dom-breakpoint", className], title, null, breakpoint);
</del><ins>+ super(["breakpoint", className], title, null, breakpoint);
</ins><span class="cx">
</span><span class="cx"> this._statusImageElement = document.createElement("img");
</span><del>- this._statusImageElement.classList.add("status-image");
</del><ins>+ this._statusImageElement.classList.add("status-image", "resolved");
</ins><span class="cx"> this.status = this._statusImageElement;
</span><span class="cx">
</span><span class="cx"> breakpoint.addEventListener(WebInspector.DOMBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPanelcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -103,3 +103,22 @@
</span><span class="cx"> .sidebar > .panel.navigation.debugger .details-section.dom-breakpoints .item.dom-node .icon {
</span><span class="cx"> content: url(../Images/DOMElement.svg);
</span><span class="cx"> }
</span><ins>+
+.sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle:before {
+ content: "";
+}
+
+.sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle {
+ padding-left: 5px;
+ font-family: Menlo, monospace;
+
+ --subtitle-padding-start: 6px;
+}
+
+body[dir=ltr] .sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle {
+ padding-left: var(--subtitle-padding-start);
+}
+
+body[dir=rtl] .sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle {
+ padding-right: var(--subtitle-padding-start);
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDebuggerSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (213690 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2017-03-10 00:53:09 UTC (rev 213690)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -179,6 +179,24 @@
</span><span class="cx"> let domBreakpointsGroup = new WebInspector.DetailsSectionGroup([this._domBreakpointsRow]);
</span><span class="cx"> let domBreakpointsSection = new WebInspector.DetailsSection("dom-breakpoints", WebInspector.UIString("DOM Breakpoints"), [domBreakpointsGroup]);
</span><span class="cx"> this.contentView.element.appendChild(domBreakpointsSection.element);
</span><ins>+
+ this._xhrBreakpointsContentTreeOutline = this.createContentTreeOutline(true);
+ this._xhrBreakpointTreeController = new WebInspector.XHRBreakpointTreeController(this._xhrBreakpointsContentTreeOutline);
+
+ this._xhrBreakpointsRow = new WebInspector.DetailsSectionRow;
+ this._xhrBreakpointsRow.element.appendChild(this._xhrBreakpointsContentTreeOutline.element);
+
+ let navigationBar = new WebInspector.NavigationBar;
+ let navigationBarWrapper = document.createElement("div");
+ navigationBarWrapper.appendChild(navigationBar.element);
+
+ let addXHRBreakpointButton = new WebInspector.ButtonNavigationItem("add-xhr-breakpoint", WebInspector.UIString("Add XHR Breakpoint"), "Images/Plus13.svg", 13, 13);
+ addXHRBreakpointButton.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._addXHRBreakpointButtonClicked, this);
+ navigationBar.addNavigationItem(addXHRBreakpointButton);
+
+ let xhrBreakpointsGroup = new WebInspector.DetailsSectionGroup([this._xhrBreakpointsRow]);
+ let xhrBreakpointsSection = new WebInspector.DetailsSection("xhr-breakpoints", WebInspector.UIString("XHR Breakpoints"), [xhrBreakpointsGroup], navigationBarWrapper);
+ this.contentView.element.appendChild(xhrBreakpointsSection.element);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> this._scriptsContentTreeOutline = this.createContentTreeOutline();
</span><span class="lines">@@ -329,6 +347,11 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (representedObject === WebInspector.domDebuggerManager.allRequestsBreakpoint) {
+ cookie[WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey] = true;
+ return;
+ }
+
</ins><span class="cx"> super.saveStateToCookie(cookie);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -343,6 +366,8 @@
</span><span class="cx"> this._allUncaughtExceptionsBreakpointTreeElement.revealAndSelect();
</span><span class="cx"> else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey])
</span><span class="cx"> this._assertionsBreakpointTreeElement.revealAndSelect();
</span><ins>+ else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey])
+ this._xhrBreakpointTreeController.revealAndSelect(WebInspector.domDebuggerManager.allRequestsBreakpoint);
</ins><span class="cx"> else
</span><span class="cx"> super.restoreStateFromCookie(cookie, relaxedMatchDelay);
</span><span class="cx"> }
</span><span class="lines">@@ -975,6 +1000,36 @@
</span><span class="cx"> this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
</span><span class="cx"> return true;
</span><span class="cx">
</span><ins>+ case WebInspector.DebuggerManager.PauseReason.XHR:
+ console.assert(WebInspector.domDebuggerManager.supported);
+ console.assert(pauseData, "Expected XHR breakpoint data, but found none.");
+ if (pauseData && pauseData.breakpointURL) {
+ let xhrBreakpoints = WebInspector.domDebuggerManager.xhrBreakpoints;
+ let xhrBreakpoint;
+ for (let breakpoint of xhrBreakpoints) {
+ if (breakpoint.url === pauseData.breakpointURL) {
+ xhrBreakpoint = breakpoint;
+ break;
+ }
+ }
+
+ if (!xhrBreakpoint)
+ return;
+
+ this._pauseReasonTreeOutline = this.createContentTreeOutline(true, true);
+
+ let xhrBreakpointTreeElement = new WebInspector.XHRBreakpointTreeElement(xhrBreakpoint, WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName, WebInspector.UIString("Triggered XHR Breakpoint"));
+ let xhrBreakpointRow = new WebInspector.DetailsSectionRow;
+ this._pauseReasonTreeOutline.appendChild(xhrBreakpointTreeElement);
+ xhrBreakpointRow.element.appendChild(this._pauseReasonTreeOutline.element);
+
+ this._pauseReasonTextRow.text = pauseData.url;
+ this._pauseReasonGroup.rows = [xhrBreakpointRow, this._pauseReasonTextRow];
+
+ return true;
+ }
+ break;
+
</ins><span class="cx"> case WebInspector.DebuggerManager.PauseReason.Other:
</span><span class="cx"> console.error("Paused for unknown reason. We should always have a reason.");
</span><span class="cx"> break;
</span><span class="lines">@@ -1067,6 +1122,27 @@
</span><span class="cx"> this._domBreakpointsRow.hideEmptyMessage();
</span><span class="cx"> this._domBreakpointsRow.element.append(this._domBreakpointsContentTreeOutline.element);
</span><span class="cx"> }
</span><ins>+
+ _addXHRBreakpointButtonClicked(event)
+ {
+ let popover = new WebInspector.InputPopover(WebInspector.UIString("Break when URL contains:"), this);
+ popover.show(event.target.element, [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
+ }
+
+ // Popover delegate
+
+ willDismissPopover(popover)
+ {
+ if (popover.result !== WebInspector.InputPopover.Result.Committed)
+ return;
+
+ let url = popover.value;
+ if (!url)
+ return;
+
+ let documentURL = WebInspector.frameResourceManager.mainFrame.url;
+ WebInspector.domDebuggerManager.addXHRBreakpoint(new WebInspector.XHRBreakpoint(documentURL, url));
+ }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> WebInspector.DebuggerSidebarPanel.DebuggerPausedStyleClassName = "paused";
</span><span class="lines">@@ -1077,3 +1153,4 @@
</span><span class="cx"> WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey = "debugger-sidebar-panel-all-exceptions-breakpoint";
</span><span class="cx"> WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey = "debugger-sidebar-panel-all-uncaught-exceptions-breakpoint";
</span><span class="cx"> WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey = "debugger-sidebar-panel-assertions-breakpoint";
</span><ins>+WebInspector.DebuggerSidebarPanel.SelectedAllRequestsCookieKey = "debugger-sidebar-panel-all-requests-breakpoint";
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsInputPopovercssfromrev213690trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementcss"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.css (from rev 213690, trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.css) (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.css         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.css        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+.popover .input-popover-content {
+ padding: 5px;
+ margin: 2px;
+}
+
+.popover .input-popover-content > .editor {
+ width: 200px;
+ margin-top: 5px;
+ padding: 4px 0 2px 0;
+ -webkit-appearance: textfield;
+ border: 1px solid hsl(0, 0%, 78%);
+ background: white;
+}
+
+.popover .input-popover-content > .editor > .CodeMirror {
+ width: calc(100% - 2px);
+ height: auto;
+}
+
+.popover .input-popover-content > .editor > .CodeMirror-scroll {
+ width: calc(100% - 2px);
+ overflow: hidden;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsInputPopoverjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.js (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/InputPopover.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.InputPopover = class InputPopover extends WebInspector.Popover
+{
+ constructor(message, delegate)
+ {
+ super(delegate);
+
+ this._message = message;
+ this._value = null;
+ this._result = WebInspector.InputPopover.Result.None;
+
+ this._targetElement = null;
+ this._preferredEdges = null;
+
+ this.windowResizeHandler = this._presentOverTargetElement.bind(this);
+ }
+
+ get value() { return this._value; }
+ get result() { return this._result; }
+
+ show(targetElement, preferredEdges)
+ {
+ this._targetElement = targetElement;
+ this._preferredEdges = preferredEdges;
+
+ let contentElement = document.createElement("div");
+ contentElement.classList.add("input-popover-content");
+
+ if (this._message) {
+ let label = document.createElement("div");
+ label.classList.add("label");
+ label.textContent = this._message;
+ contentElement.appendChild(label);
+ }
+
+ this._inputElement = document.createElement("input");
+ this._inputElement.type = "text";
+
+ this._inputElement.addEventListener("keydown", (event) => {
+ if (!isEnterKey(event))
+ return;
+
+ this._result = WebInspector.InputPopover.Result.Committed;
+ this._value = event.target.value;
+
+ this.dismiss();
+ });
+
+ contentElement.appendChild(this._inputElement);
+ this.content = contentElement;
+
+ this._presentOverTargetElement();
+ }
+
+ // Private
+
+ _presentOverTargetElement()
+ {
+ if (!this._targetElement)
+ return;
+
+ let targetFrame = WebInspector.Rect.rectFromClientRect(this._targetElement.getBoundingClientRect());
+ this.present(targetFrame, this._preferredEdges);
+
+ this._inputElement.select();
+ }
+};
+
+WebInspector.InputPopover.Result = {
+ None: Symbol("result-none"),
+ Cancelled: Symbol("result-cancelled"),
+ Committed: Symbol("result-committed"),
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsXHRBreakpointTreeElementjsfromrev213690trunkSourceWebInspectorUIUserInterfaceViewsDOMBreakpointTreeElementjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js (from rev 213690, trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js) (0 => 213691)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js         (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js        2017-03-10 00:53:48 UTC (rev 213691)
</span><span class="lines">@@ -0,0 +1,138 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.XHRBreakpointTreeElement = class XHRBreakpointTreeElement extends WebInspector.GeneralTreeElement
+{
+ constructor(breakpoint, className, title)
+ {
+ console.assert(breakpoint instanceof WebInspector.XHRBreakpoint);
+
+ if (!className)
+ className = WebInspector.BreakpointTreeElement.GenericLineIconStyleClassName;
+
+ let subtitle;
+ if (!title) {
+ title = WebInspector.UIString("URL contains:");
+ subtitle = breakpoint.url;
+ }
+
+ super(["breakpoint", className], title, subtitle, breakpoint);
+
+ this._statusImageElement = document.createElement("img");
+ this._statusImageElement.classList.add("status-image", "resolved");
+ this.status = this._statusImageElement;
+
+ breakpoint.addEventListener(WebInspector.XHRBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
+
+ this._updateStatus();
+ }
+
+ // Protected
+
+ onattach()
+ {
+ super.onattach();
+
+ this._boundStatusImageElementClicked = this._statusImageElementClicked.bind(this);
+ this._boundStatusImageElementFocused = this._statusImageElementFocused.bind(this);
+ this._boundStatusImageElementMouseDown = this._statusImageElementMouseDown.bind(this);
+
+ this._statusImageElement.addEventListener("click", this._boundStatusImageElementClicked);
+ this._statusImageElement.addEventListener("focus", this._boundStatusImageElementFocused);
+ this._statusImageElement.addEventListener("mousedown", this._boundStatusImageElementMouseDown);
+ }
+
+ ondetach()
+ {
+ this._statusImageElement.removeEventListener("click", this._boundStatusImageElementClicked);
+ this._statusImageElement.removeEventListener("focus", this._boundStatusImageElementFocused);
+ this._statusImageElement.removeEventListener("mousedown", this._boundStatusImageElementMouseDown);
+
+ this._boundStatusImageElementClicked = null;
+ this._boundStatusImageElementFocused = null;
+ this._boundStatusImageElementMouseDown = null;
+ }
+
+ ondelete()
+ {
+ WebInspector.domDebuggerManager.removeXHRBreakpoint(this.representedObject);
+ return true;
+ }
+
+ onenter()
+ {
+ this._toggleBreakpoint();
+ return true;
+ }
+
+ onspace()
+ {
+ this._toggleBreakpoint();
+ return true;
+ }
+
+ populateContextMenu(contextMenu, event)
+ {
+ let breakpoint = this.representedObject;
+ let label = breakpoint.disabled ? WebInspector.UIString("Enable Breakpoint") : WebInspector.UIString("Disable Breakpoint");
+ contextMenu.appendItem(label, this._toggleBreakpoint.bind(this));
+
+ if (WebInspector.domDebuggerManager.isBreakpointRemovable(breakpoint)) {
+ contextMenu.appendSeparator();
+ contextMenu.appendItem(WebInspector.UIString("Delete Breakpoint"), function() {
+ WebInspector.domDebuggerManager.removeXHRBreakpoint(breakpoint);
+ });
+ }
+ }
+
+ // Private
+
+ _statusImageElementClicked(event)
+ {
+ this._toggleBreakpoint();
+ }
+
+ _statusImageElementFocused(event)
+ {
+ // Prevent tree outline focus.
+ event.stopPropagation();
+ }
+
+ _statusImageElementMouseDown(event)
+ {
+ // Prevent tree element selection.
+ event.stopPropagation();
+ }
+
+ _toggleBreakpoint()
+ {
+ this.representedObject.disabled = !this.representedObject.disabled;
+ }
+
+ _updateStatus()
+ {
+ this._statusImageElement.classList.toggle("disabled", this.representedObject.disabled);
+ }
+};
</ins></span></pre>
</div>
</div>
</body>
</html>