- Revision
- 221880
- Author
- [email protected]
- Date
- 2017-09-11 15:09:19 -0700 (Mon, 11 Sep 2017)
Log Message
Web Inspector: Include a DebugContentView for debugging
https://bugs.webkit.org/show_bug.cgi?id=176733
Patch by Joseph Pecoraro <[email protected]> on 2017-09-11
Reviewed by Matt Baker.
Provide a DebugContentView which can be used to debug lifecycle
events of a ContentView (shown, hidden, closed), and displays a
provided string. It can be created like so:
`new WI.DebugContentView("Name")`
* UserInterface/Debug/DebugContentView.css: Added.
(.content-view.debug):
* UserInterface/Debug/DebugContentView.js: Added.
(WI.DebugContentView):
(WI.DebugContentView.prototype.shown):
(WI.DebugContentView.prototype.hidden):
(WI.DebugContentView.prototype.closed):
Log events for debugging.
* UserInterface/Main.html:
Include new Debug resources.
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (221879 => 221880)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-09-11 21:52:27 UTC (rev 221879)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-09-11 22:09:19 UTC (rev 221880)
@@ -1,5 +1,30 @@
2017-09-11 Joseph Pecoraro <[email protected]>
+ Web Inspector: Include a DebugContentView for debugging
+ https://bugs.webkit.org/show_bug.cgi?id=176733
+
+ Reviewed by Matt Baker.
+
+ Provide a DebugContentView which can be used to debug lifecycle
+ events of a ContentView (shown, hidden, closed), and displays a
+ provided string. It can be created like so:
+
+ `new WI.DebugContentView("Name")`
+
+ * UserInterface/Debug/DebugContentView.css: Added.
+ (.content-view.debug):
+ * UserInterface/Debug/DebugContentView.js: Added.
+ (WI.DebugContentView):
+ (WI.DebugContentView.prototype.shown):
+ (WI.DebugContentView.prototype.hidden):
+ (WI.DebugContentView.prototype.closed):
+ Log events for debugging.
+
+ * UserInterface/Main.html:
+ Include new Debug resources.
+
+2017-09-11 Joseph Pecoraro <[email protected]>
+
Web Inspector: Make Dashboard Timeline icon and Timeline tab icon more similar
https://bugs.webkit.org/show_bug.cgi?id=176582
Added: trunk/Source/WebInspectorUI/UserInterface/Debug/DebugContentView.css (0 => 221880)
--- trunk/Source/WebInspectorUI/UserInterface/Debug/DebugContentView.css (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Debug/DebugContentView.css 2017-09-11 22:09:19 UTC (rev 221880)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+.content-view.debug {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+ padding: 15px;
+ font-size: 64px;
+ color: var(--text-color-gray-medium);
+}
Added: trunk/Source/WebInspectorUI/UserInterface/Debug/DebugContentView.js (0 => 221880)
--- trunk/Source/WebInspectorUI/UserInterface/Debug/DebugContentView.js (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Debug/DebugContentView.js 2017-09-11 22:09:19 UTC (rev 221880)
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+WI.DebugContentView = class DebugContentView extends WI.ContentView
+{
+ constructor(string)
+ {
+ super(new String(string));
+
+ this._string = string;
+
+ this.element.classList.add("debug");
+ this.element.textContent = string;
+ }
+
+ // Protected
+
+ shown()
+ {
+ super.shown();
+ console.debug(`shown: ${this._string}`);
+ }
+
+ hidden()
+ {
+ console.debug(`hidden: ${this._string}`);
+ super.hidden();
+ }
+
+ closed()
+ {
+ console.debug(`closed: ${this._string}`);
+ super.closed();
+ }
+}
Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (221879 => 221880)
--- trunk/Source/WebInspectorUI/UserInterface/Main.html 2017-09-11 21:52:27 UTC (rev 221879)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html 2017-09-11 22:09:19 UTC (rev 221880)
@@ -227,6 +227,7 @@
<link rel="stylesheet" href=""
<link rel="stylesheet" href=""
+ <link rel="stylesheet" href=""
<script src=""
@@ -818,6 +819,7 @@
<script src=""
<script src=""
<script src=""
+ <script src=""
<script>
WI.loaded();