Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (187401 => 187402)
--- trunk/Source/WebInspectorUI/ChangeLog 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/ChangeLog 2015-07-26 05:46:30 UTC (rev 187402)
@@ -1,3 +1,68 @@
+2015-07-25 Nikita Vasilyev <[email protected]>
+
+ Web Inspector: Start using Node.prototype.append
+ https://bugs.webkit.org/show_bug.cgi?id=147301
+
+ Convert all instances of element.appendChild(document.createTextNode(aString))
+ to element.append(aString).
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Base/DOMUtilities.js:
+ * UserInterface/Base/Main.js:
+ (WebInspector.linkifyLocation):
+ (WebInspector.linkifyStringAsFragmentWithCustomLinkifier):
+ * UserInterface/Models/Breakpoint.js:
+ (WebInspector.Breakpoint.prototype._editBreakpointPopoverContentElement):
+ * UserInterface/Views/BoxModelDetailsSectionRow.js:
+ (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics):
+ * UserInterface/Views/CSSStyleDeclarationSection.js:
+ (WebInspector.CSSStyleDeclarationSection.prototype.refresh):
+ * UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
+ (WebInspector.CSSStyleDetailsSidebarPanel):
+ * UserInterface/Views/ChartDetailsSectionRow.js:
+ (WebInspector.ChartDetailsSectionRow.prototype._createLegendItem):
+ * UserInterface/Views/ConsoleMessageView.js:
+ (WebInspector.ConsoleMessageView.prototype._appendMessageTextAndArguments):
+ (WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
+ * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
+ (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
+ (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
+ * UserInterface/Views/DOMTreeElement.js:
+ (WebInspector.DOMTreeElement.prototype._insertInLastAttributePosition):
+ (WebInspector.DOMTreeElement.prototype._buildAttributeDOM):
+ (WebInspector.DOMTreeElement.prototype._buildTagDOM):
+ (WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
+ defaultElement variable is unused, remove it.
+
+ * UserInterface/Views/DataGrid.js:
+ (WebInspector.DataGridNode.prototype.createCell.get if):
+ (WebInspector.DataGridNode.prototype.createCell):
+ * UserInterface/Views/DebuggerDashboardView.js:
+ (WebInspector.DebuggerDashboardView.prototype._rebuildLocation):
+ * UserInterface/Views/EventListenerSectionGroup.js:
+ (WebInspector.EventListenerSectionGroup.prototype._functionTextOrLink):
+ (WebInspector.EventListenerSectionGroup):
+ * UserInterface/Views/FormattedValue.js:
+ (WebInspector.FormattedValue.createLinkifiedElementString):
+ (WebInspector.FormattedValue.createElementForNodePreview):
+ * UserInterface/Views/ObjectPreviewView.js:
+ (WebInspector.ObjectPreviewView.prototype._appendEntryPreviews):
+ (WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
+ * UserInterface/Views/ResourceDetailsSidebarPanel.js:
+ (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestDataSection):
+ (WebInspector.ResourceDetailsSidebarPanel):
+ * UserInterface/Views/RulesStyleDetailsPanel.js:
+ (WebInspector.RulesStyleDetailsPanel.prototype.refresh.addNewRuleButton):
+ (WebInspector.RulesStyleDetailsPanel.prototype.refresh.insertMediaOrInheritanceLabel):
+ * UserInterface/Views/SearchResultTreeElement.js:
+ (WebInspector.SearchResultTreeElement.truncateAndHighlightTitle):
+ * UserInterface/Views/SyntaxHighlightingSupport.js:
+ (.appendText):
+ (WebInspector.syntaxHighlightStringAsDocumentFragment):
+ * UserInterface/Views/TimelineDataGridNode.js:
+ (WebInspector.TimelineDataGridNode.prototype.createCellContent):
+
2015-07-24 Joseph Pecoraro <[email protected]>
Web Inspector: Add custom parameter lists for new DOM append/prepend/before/after/replaceWith methods
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -92,7 +92,7 @@
var displayName = WebInspector.displayNameForNode(node);
var link = document.createElement("span");
- link.appendChild(document.createTextNode(displayName));
+ link.append(displayName);
link.setAttribute("role", "link");
link.className = "node-link";
link.title = displayName;
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -1814,7 +1814,7 @@
anchor.lineNumber = lineNumber;
if (className)
anchor.className = className;
- anchor.appendChild(document.createTextNode(WebInspector.displayNameForURL(url) + ":" + lineNumber));
+ anchor.append(WebInspector.displayNameForURL(url) + ":" + lineNumber);
return anchor;
}
@@ -1883,7 +1883,7 @@
linkString = linkString[0];
var linkIndex = string.indexOf(linkString);
var nonLink = string.substring(0, linkIndex);
- container.appendChild(document.createTextNode(nonLink));
+ container.append(nonLink);
var title = linkString;
var realURL = (linkString.startsWith("www.") ? "http://" + linkString : linkString);
@@ -1897,7 +1897,7 @@
}
if (string)
- container.appendChild(document.createTextNode(string));
+ container.append(string);
return container;
};
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -396,7 +396,7 @@
var checkboxLabel = document.createElement("label");
checkboxLabel.className = "toggle";
checkboxLabel.appendChild(checkboxElement);
- checkboxLabel.appendChild(document.createTextNode(this._sourceCodeLocation.displayLocationString()));
+ checkboxLabel.append(this._sourceCodeLocation.displayLocationString());
var table = document.createElement("table");
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -216,10 +216,7 @@
if (name === "content") {
var widthElement = createContentAreaWidthElement.call(this, style);
var heightElement = createContentAreaHeightElement.call(this, style);
-
- boxElement.appendChild(widthElement);
- boxElement.appendChild(document.createTextNode(" \u00D7 "));
- boxElement.appendChild(heightElement);
+ boxElement.append(widthElement, " \u00D7 ", heightElement);
} else {
var suffix = (name === "border" ? "-width" : "");
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -178,7 +178,7 @@
this._originElement.removeChildren();
this._selectorElements = [];
- this._originElement.appendChild(document.createTextNode(" \u2014 "));
+ this._originElement.append(" \u2014 ");
function appendSelector(selector, matched)
{
@@ -231,7 +231,7 @@
for (var i = 0; i < selectors.length; ++i) {
appendSelector.call(this, selectors[i], alwaysMatch || matchedSelectorIndices.includes(i));
if (i < selectors.length - 1)
- this._selectorElement.appendChild(document.createTextNode(", "));
+ this._selectorElement.append(", ");
}
} else
appendSelectorTextKnownToMatch.call(this, this._style.ownerRule.selectorText);
@@ -261,19 +261,19 @@
console.assert(originString);
if (originString)
- this._originElement.appendChild(document.createTextNode(originString));
+ this._originElement.append(originString);
}
break;
case WebInspector.CSSStyleDeclaration.Type.Inline:
appendSelectorTextKnownToMatch.call(this, WebInspector.displayNameForNode(this._style.node));
- this._originElement.appendChild(document.createTextNode(WebInspector.UIString("Style Attribute")));
+ this._originElement.append(WebInspector.UIString("Style Attribute"));
break;
case WebInspector.CSSStyleDeclaration.Type.Attribute:
appendSelectorTextKnownToMatch.call(this, WebInspector.displayNameForNode(this._style.node));
- this._originElement.appendChild(document.createTextNode(WebInspector.UIString("HTML Attributes")));
+ this._originElement.append(WebInspector.UIString("HTML Attributes"));
break;
}
},
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -56,7 +56,7 @@
this._forcedPseudoClassCheckboxes[pseudoClass] = checkboxElement;
labelElement.appendChild(checkboxElement);
- labelElement.appendChild(document.createTextNode(label));
+ labelElement.append(label);
if (!groupElement || groupElement.children.length === 2) {
groupElement = document.createElement("div");
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ChartDetailsSectionRow.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ChartDetailsSectionRow.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ChartDetailsSectionRow.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -124,8 +124,7 @@
var labelElement = document.createElement("div");
labelElement.className = "label";
- labelElement.appendChild(colorSwatchElement);
- labelElement.appendChild(document.createTextNode(item.label));
+ labelElement.append(colorSwatchElement, item.label);
var valueElement = document.createElement("div");
valueElement.className = "value";
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -228,7 +228,7 @@
switch (this._message.type) {
case WebInspector.ConsoleMessage.MessageType.Trace:
// FIXME: We should use a better string then console.trace.
- element.appendChild(document.createTextNode("console.trace()"));
+ element.append("console.trace()");
break;
case WebInspector.ConsoleMessage.MessageType.Assert:
@@ -256,7 +256,7 @@
case WebInspector.ConsoleMessage.MessageType.StartGroup:
case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed:
var groupName = this._message.messageText || WebInspector.UIString("Group");
- element.appendChild(document.createTextNode(groupName));
+ element.append(groupName);
this._extraParameters = null;
break;
@@ -430,7 +430,7 @@
this._extraParameters = parameters;
} else {
var defaultMessage = WebInspector.UIString("No message");
- builderElement.appendChild(document.createTextNode(defaultMessage));
+ builderElement.append(defaultMessage);
}
// Trailing parameters.
@@ -459,7 +459,7 @@
this._extraParameters = null;
} else {
// Multiple objects. Show an indicator.
- builderElement.appendChild(document.createTextNode(" "));
+ builderElement.append(" ");
var enclosedElement = builderElement.appendChild(document.createElement("span"));
enclosedElement.classList.add("console-message-enclosed");
enclosedElement.textContent = "(" + parameters.length + ")";
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -416,10 +416,10 @@
liveRegionStatusNode = document.createElement("div");
liveRegionStatusNode.className = "value-with-clarification";
liveRegionStatusNode.setAttribute("role", "text");
- liveRegionStatusNode.appendChild(document.createTextNode(liveRegionStatus));
+ liveRegionStatusNode.append(liveRegionStatus);
var clarificationNode = document.createElement("div");
clarificationNode.className = "clarification";
- clarificationNode.appendChild(document.createTextNode(WebInspector.UIString("Region announced in its entirety.")));
+ clarificationNode.append(WebInspector.UIString("Region announced in its entirety."));
liveRegionStatusNode.appendChild(clarificationNode);
}
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -562,9 +562,7 @@
else {
var nodeName = tag.textContent.match(/^<(.*?)>$/)[1];
tag.textContent = "";
- tag.appendChild(document.createTextNode("<" + nodeName));
- tag.appendChild(node);
- tag.appendChild(document.createTextNode(">"));
+ tag.append("<" + nodeName, node, ">");
}
this.updateSelection();
@@ -1045,7 +1043,7 @@
attrNameElement.textContent = name;
if (hasText)
- attrSpanElement.appendChild(document.createTextNode("=\u200B\""));
+ attrSpanElement.append("=\u200B\"");
if (name === "src" || name === "href") {
var baseURL = node.ownerDocument ? node.ownerDocument.documentURL : null;
@@ -1073,7 +1071,7 @@
}
if (hasText)
- attrSpanElement.appendChild(document.createTextNode("\""));
+ attrSpanElement.append("\"");
}
_buildTagDOM(parentElement, tagName, isClosingTag, isDistinctTreeElement)
@@ -1085,19 +1083,19 @@
if (node.isInShadowTree())
classes.push("shadow");
var tagElement = parentElement.createChild("span", classes.join(" "));
- tagElement.appendChild(document.createTextNode("<"));
+ tagElement.append("<");
var tagNameElement = tagElement.createChild("span", isClosingTag ? "" : "html-tag-name");
tagNameElement.textContent = (isClosingTag ? "/" : "") + tagName;
if (!isClosingTag && node.hasAttributes()) {
var attributes = node.attributes();
for (var i = 0; i < attributes.length; ++i) {
var attr = attributes[i];
- tagElement.appendChild(document.createTextNode(" "));
+ tagElement.append(" ");
this._buildAttributeDOM(tagElement, attr.name, attr.value, node);
}
}
- tagElement.appendChild(document.createTextNode(">"));
- parentElement.appendChild(document.createTextNode("\u200B"));
+ tagElement.append(">");
+ parentElement.append("\u200B");
}
_nodeTitleInfo()
@@ -1144,7 +1142,7 @@
if (this.hasChildren) {
var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
textNodeElement.textContent = "\u2026";
- info.titleDOM.appendChild(document.createTextNode("\u200B"));
+ info.titleDOM.append("\u200B");
}
this._buildTagDOM(info.titleDOM, tagName, true, false);
}
@@ -1163,7 +1161,7 @@
else
textNodeElement.textContent = textChild.nodeValue();
- info.titleDOM.appendChild(document.createTextNode("\u200B"));
+ info.titleDOM.append("\u200B");
this._buildTagDOM(info.titleDOM, tagName, true, false);
info.hasChildren = false;
@@ -1178,37 +1176,37 @@
var newNode = info.titleDOM.createChild("span", "html-text-node large");
newNode.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(trimedNodeValue(), "text/css"));
} else {
- info.titleDOM.appendChild(document.createTextNode("\""));
+ info.titleDOM.append("\"");
var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
textNodeElement.textContent = node.nodeValue();
- info.titleDOM.appendChild(document.createTextNode("\""));
+ info.titleDOM.append("\"");
}
break;
case Node.COMMENT_NODE:
var commentElement = info.titleDOM.createChild("span", "html-comment");
- commentElement.appendChild(document.createTextNode("<!--" + node.nodeValue() + "-->"));
+ commentElement.append("<!--" + node.nodeValue() + "-->");
break;
case Node.DOCUMENT_TYPE_NODE:
var docTypeElement = info.titleDOM.createChild("span", "html-doctype");
- docTypeElement.appendChild(document.createTextNode("<!DOCTYPE " + node.nodeName()));
+ docTypeElement.append("<!DOCTYPE " + node.nodeName());
if (node.publicId) {
- docTypeElement.appendChild(document.createTextNode(" PUBLIC \"" + node.publicId + "\""));
+ docTypeElement.append(" PUBLIC \"" + node.publicId + "\"");
if (node.systemId)
- docTypeElement.appendChild(document.createTextNode(" \"" + node.systemId + "\""));
+ docTypeElement.append(" \"" + node.systemId + "\"");
} else if (node.systemId)
- docTypeElement.appendChild(document.createTextNode(" SYSTEM \"" + node.systemId + "\""));
+ docTypeElement.append(" SYSTEM \"" + node.systemId + "\"");
if (node.internalSubset)
- docTypeElement.appendChild(document.createTextNode(" [" + node.internalSubset + "]"));
+ docTypeElement.append(" [" + node.internalSubset + "]");
- docTypeElement.appendChild(document.createTextNode(">"));
+ docTypeElement.append(">");
break;
case Node.CDATA_SECTION_NODE:
var cdataElement = info.titleDOM.createChild("span", "html-text-node");
- cdataElement.appendChild(document.createTextNode("<![CDATA[" + node.nodeValue() + "]]>"));
+ cdataElement.append("<![CDATA[" + node.nodeValue() + "]]>");
break;
case Node.PROCESSING_INSTRUCTION_NODE:
@@ -1216,11 +1214,11 @@
var data = ""
var dataString = data.length ? " " + data : "";
var title = "<?" + node.nodeNameInCorrectCase() + dataString + "?>";
- processingInstructionElement.appendChild(document.createTextNode(title));
+ processingInstructionElement.append(title);
break;
default:
- var defaultElement = info.titleDOM.appendChild(document.createTextNode(node.nodeNameInCorrectCase().collapseWhitespace()));
+ info.titleDOM.append(node.nodeNameInCorrectCase().collapseWhitespace());
}
return info;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -1578,7 +1578,7 @@
var div = cellElement.createChild("div");
var content = this.createCellContent(columnIdentifier, cellElement);
- div.appendChild(content instanceof Node ? content : document.createTextNode(content));
+ div.append(content);
if (columnIdentifier === this.dataGrid.disclosureColumnIdentifier) {
cellElement.classList.add("disclosure");
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerDashboardView.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerDashboardView.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerDashboardView.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -84,7 +84,7 @@
iconElement.appendChild(iconImageElement);
var nameElement = document.createElement("div");
- nameElement.appendChild(document.createTextNode(functionName));
+ nameElement.append(functionName);
nameElement.classList.add("function-name");
this._locationElement.appendChild(nameElement);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -95,8 +95,7 @@
return linkElement;
var fragment = document.createDocumentFragment();
- fragment.appendChild(linkElement);
- fragment.appendChild(document.createTextNode(functionName));
+ fragment.append(linkElement, functionName);
return fragment;
}
};
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -39,9 +39,7 @@
{
var span = document.createElement("span");
span.className = "formatted-string";
- span.appendChild(document.createTextNode("\""));
- span.appendChild(WebInspector.linkifyStringAsFragment(string.replace(/"/g, "\\\"")));
- span.appendChild(document.createTextNode("\""));
+ span.append("\"", WebInspector.linkifyStringAsFragment(string.replace(/"/g, "\\\"")), "\"");
return span;
};
@@ -102,27 +100,27 @@
var tag = document.createElement("span");
tag.className = "html-tag";
- tag.appendChild(document.createTextNode("<"));
+ tag.append("<");
var tagName = tag.appendChild(document.createElement("span"));
tagName.className = "html-tag-name";
tagName.textContent = matches[1];
if (matches[2]) {
- tag.appendChild(document.createTextNode(" "));
+ tag.append(" ");
var attribute = tag.appendChild(document.createElement("span"));
attribute.className = "html-attribute";
var attributeName = attribute.appendChild(document.createElement("span"));
attributeName.className = "html-attribute-name";
attributeName.textContent = matches[2];
- attribute.appendChild(document.createTextNode("=\""));
+ attribute.append("=\"");
var attributeValue = attribute.appendChild(document.createElement("span"));
attributeValue.className = "html-attribute-value";
attributeValue.textContent = matches[3];
- attribute.appendChild(document.createTextNode("\""));
+ attribute.append("\"");
}
- tag.appendChild(document.createTextNode(">"));
+ tag.append(">");
span.appendChild(tag);
return span;
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -152,18 +152,18 @@
var isIterator = preview.subtype === "iterator";
- element.appendChild(document.createTextNode(isIterator ? "[" : "{"));
+ element.append(isIterator ? "[" : "{");
var limit = Math.min(preview.collectionEntryPreviews.length, this._numberOfPropertiesToShowInMode());
for (var i = 0; i < limit; ++i) {
if (i > 0)
- element.appendChild(document.createTextNode(", "));
+ element.append(", ");
var keyPreviewLossless = true;
var entry = preview.collectionEntryPreviews[i];
if (entry.keyPreview) {
keyPreviewLossless = this._appendPreview(element, entry.keyPreview);
- element.appendChild(document.createTextNode(" => "));
+ element.append(" => ");
}
var valuePreviewLossless = this._appendPreview(element, entry.valuePreview);
@@ -178,8 +178,8 @@
}
if (overflow)
- element.appendChild(document.createTextNode(", \u2026"));
- element.appendChild(document.createTextNode(isIterator ? "]" : "}"));
+ element.append(", \u2026");
+ element.append(isIterator ? "]" : "}");
return lossless;
}
@@ -200,7 +200,7 @@
// FIXME: Array previews should have better sparse support: (undefined × 10).
var isArray = preview.subtype === "array";
- element.appendChild(document.createTextNode(isArray ? "[" : "{"));
+ element.append(isArray ? "[" : "{");
var numberAdded = 0;
var limit = this._numberOfPropertiesToShowInMode();
@@ -216,13 +216,13 @@
continue;
if (numberAdded++ > 0)
- element.appendChild(document.createTextNode(", "));
+ element.append(", ");
if (!isArray || property.name != i) {
var nameElement = element.appendChild(document.createElement("span"));
nameElement.className = "name";
nameElement.textContent = property.name;
- element.appendChild(document.createTextNode(": "));
+ element.append(": ");
}
if (property.valuePreview)
@@ -239,8 +239,8 @@
}
if (overflow)
- element.appendChild(document.createTextNode(", \u2026"));
- element.appendChild(document.createTextNode(isArray ? "]" : "}"));
+ element.append(", \u2026");
+ element.append(isArray ? "]" : "}");
return lossless;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -459,7 +459,7 @@
var dataValue = document.createDocumentFragment();
- dataValue.appendChild(document.createTextNode(sizeValue));
+ dataValue.append(sizeValue);
var goToButton = dataValue.appendChild(WebInspector.createGoToArrowButton());
goToButton.addEventListener("click", this._goToRequestDataClicked.bind(this));
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -170,8 +170,7 @@
newRuleButton.className = "new-rule";
newRuleButton.addEventListener("click", this._newRuleClicked.bind(this));
- newRuleButton.appendChild(document.createElement("img"));
- newRuleButton.appendChild(document.createTextNode(WebInspector.UIString("New Rule")));
+ newRuleButton.append(document.createElement("img"), WebInspector.UIString("New Rule"));
newDOMFragment.appendChild(newRuleButton);
}
@@ -217,13 +216,10 @@
var mediaLabel = document.createElement("div");
mediaLabel.className = "label";
- mediaLabel.appendChild(prefixElement);
- mediaLabel.appendChild(document.createTextNode(media.text));
+ mediaLabel.append(prefixElement, media.text);
- if (media.sourceCodeLocation) {
- mediaLabel.appendChild(document.createTextNode(" \u2014 "));
- mediaLabel.appendChild(WebInspector.createSourceCodeLocationLink(media.sourceCodeLocation, true));
- }
+ if (media.sourceCodeLocation)
+ mediaLabel.append(" \u2014 ", WebInspector.createSourceCodeLocationLink(media.sourceCodeLocation, true));
newDOMFragment.appendChild(mediaLabel);
@@ -240,8 +236,7 @@
var mediaLabel = document.createElement("div");
mediaLabel.className = "label";
- mediaLabel.appendChild(prefixElement);
- mediaLabel.appendChild(document.createTextNode("all"));
+ mediaLabel.append(prefixElement, "all");
newDOMFragment.appendChild(mediaLabel);
hasMediaOrInherited.push(mediaLabel);
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -64,14 +64,14 @@
var highlightedTitle = document.createDocumentFragment();
- highlightedTitle.appendChild(document.createTextNode(modifiedTitle.substring(0, searchTermIndex)));
+ highlightedTitle.append(modifiedTitle.substring(0, searchTermIndex));
var highlightSpan = document.createElement("span");
highlightSpan.className = "highlighted";
- highlightSpan.appendChild(document.createTextNode(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length)));
+ highlightSpan.append(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length));
highlightedTitle.appendChild(highlightSpan);
- highlightedTitle.appendChild(document.createTextNode(modifiedTitle.substring(searchTermIndex + searchTerm.length)));
+ highlightedTitle.append(modifiedTitle.substring(searchTermIndex + searchTerm.length));
return highlightedTitle;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingSupport.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingSupport.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingSupport.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -32,7 +32,7 @@
function appendText(text, style)
{
if (!style) {
- resultFragment.appendChild(document.createTextNode(text));
+ resultFragment.append(text);
return;
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js (187401 => 187402)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js 2015-07-26 05:12:26 UTC (rev 187401)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js 2015-07-26 05:46:30 UTC (rev 187402)
@@ -187,7 +187,7 @@
// Show the function name and icon.
cell.classList.add(WebInspector.CallFrameView.FunctionIconStyleClassName);
- fragment.appendChild(document.createTextNode(functionName));
+ fragment.append(functionName);
var subtitleElement = document.createElement("span");
subtitleElement.className = WebInspector.LayoutTimelineDataGridNode.SubtitleStyleClassName;
@@ -201,9 +201,8 @@
var icon = document.createElement("div");
icon.className = WebInspector.LayoutTimelineDataGridNode.IconStyleClassName;
- fragment.appendChild(icon);
- fragment.appendChild(document.createTextNode(functionName));
+ fragment.append(icon, functionName);
return fragment;
}