Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (213874 => 213875)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-03-13 22:29:47 UTC (rev 213874)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-03-13 22:35:29 UTC (rev 213875)
@@ -1,3 +1,27 @@
+2017-03-13 Nikita Vasilyev <[email protected]>
+
+ Web Inspector: WebSockets: color of outgoing message icon should match text color
+ https://bugs.webkit.org/show_bug.cgi?id=169512
+ <rdar://problem/30994284>
+
+ Reviewed by Devin Rousso.
+
+ Include SVG icon as an inline SVG element to make currentColor work.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/Main.html:
+ * UserInterface/Views/WebSocketContentView.css:
+ (.web-socket.content-view .outgoing .icon): Deleted.
+ * UserInterface/Views/WebSocketContentView.js:
+ (WebInspector.WebSocketContentView):
+ (WebInspector.WebSocketContentView.prototype.addFrame):
+ (WebInspector.WebSocketContentView.prototype._addRow):
+ (WebInspector.WebSocketContentView.prototype._timeStringFromTimestamp): Deleted.
+ * UserInterface/Views/WebSocketDataGridNode.js: Added.
+ (WebInspector.WebSocketDataGridNode.prototype.createCellContent):
+ (WebInspector.WebSocketDataGridNode.prototype._timeStringFromTimestamp):
+ (WebInspector.WebSocketDataGridNode):
+
2017-03-13 Devin Rousso <[email protected]>
Web Inspector: Event Listeners detail section is unhelpful, default should show listeners by element rather than by event
Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (213874 => 213875)
--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2017-03-13 22:29:47 UTC (rev 213874)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2017-03-13 22:35:29 UTC (rev 213875)
@@ -582,6 +582,7 @@
localizedStrings["Originally %s"] = "Originally %s";
localizedStrings["Other"] = "Other";
localizedStrings["Other Issue"] = "Other Issue";
+localizedStrings["Outgoing message"] = "Outgoing message";
localizedStrings["Outline"] = "Outline";
localizedStrings["Output: "] = "Output: ";
localizedStrings["Outset"] = "Outset";
Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (213874 => 213875)
--- trunk/Source/WebInspectorUI/UserInterface/Main.html 2017-03-13 22:29:47 UTC (rev 213874)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html 2017-03-13 22:35:29 UTC (rev 213875)
@@ -682,6 +682,7 @@
<script src=""
<script src=""
<script src=""
+ <script src=""
<script src=""
<script src=""
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketContentView.css (213874 => 213875)
--- trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketContentView.css 2017-03-13 22:29:47 UTC (rev 213874)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketContentView.css 2017-03-13 22:35:29 UTC (rev 213875)
@@ -61,10 +61,6 @@
margin-left: 2px;
}
-.web-socket.content-view .outgoing .icon {
- background-image: url("../Images/ArrowUp.svg");
-}
-
.web-socket.content-view .data-grid.variable-height-rows table.data tr:nth-child(odd) {
background-color: unset;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketContentView.js (213874 => 213875)
--- trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketContentView.js 2017-03-13 22:29:47 UTC (rev 213874)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketContentView.js 2017-03-13 22:35:29 UTC (rev 213875)
@@ -42,7 +42,6 @@
let columns = {data: {}};
columns.data.title = WebInspector.UIString("Data");
columns.data.sortable = false;
- columns.data.icon = true;
columns.data.width = "85%";
if (this._showTimeColumn)
@@ -103,7 +102,7 @@
opcode === WebInspector.WebSocketResource.OpCodes.TextFrame ? "text-frame" : "non-text-frame"
];
- this._addRow(nodeText, time, classNames);
+ this._addRow(nodeText, time, classNames, isOutgoing);
}
// Private
@@ -119,21 +118,16 @@
this._framesRendered = framesLength;
}
- _addRow(data, time, classNames)
+ _addRow(data, time, classNames, isOutgoing)
{
let node;
if (this._showTimeColumn)
- node = new WebInspector.DataGridNode({data, time: this._timeStringFromTimestamp(time)});
+ node = new WebInspector.WebSocketDataGridNode({data, time, isOutgoing});
else
- node = new WebInspector.DataGridNode({data});
+ node = new WebInspector.WebSocketDataGridNode({data, isOutgoing});
this._dataGrid.appendChild(node);
node.element.classList.add(...classNames);
}
-
- _timeStringFromTimestamp(timestamp)
- {
- return new Date(timestamp * 1000).toLocaleTimeString();
- }
};
Added: trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketDataGridNode.js (0 => 213875)
--- trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketDataGridNode.js (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/WebSocketDataGridNode.js 2017-03-13 22:35:29 UTC (rev 213875)
@@ -0,0 +1,54 @@
+/*
+ * 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.WebSocketDataGridNode = class WebSocketDataGridNode extends WebInspector.DataGridNode
+{
+ // Public
+
+ createCellContent(columnIdentifier)
+ {
+ if (columnIdentifier === "data") {
+ let fragment = document.createDocumentFragment();
+ if (this._data.isOutgoing) {
+ let iconElement = useSVGSymbol("Images/ArrowUp.svg", "icon", WebInspector.UIString("Outgoing message"));
+ fragment.appendChild(iconElement);
+ }
+ fragment.appendChild(document.createTextNode(this._data.data));
+ return fragment;
+ }
+
+ if (columnIdentifier === "time")
+ return this._timeStringFromTimestamp(this._data.time);
+
+ return super.createCellContent(columnIdentifier);
+ }
+
+ // Private
+
+ _timeStringFromTimestamp(timestamp)
+ {
+ return new Date(timestamp * 1000).toLocaleTimeString();
+ }
+};