Changeset 187402 in webkit


Ignore:
Timestamp:
Jul 25, 2015 10:46:30 PM (9 years ago)
Author:
Nikita Vasilyev
Message:

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):

Location:
trunk/Source/WebInspectorUI
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r187350 r187402  
     12015-07-25  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: Start using Node.prototype.append
     4        https://bugs.webkit.org/show_bug.cgi?id=147301
     5
     6        Convert all instances of element.appendChild(document.createTextNode(aString))
     7        to element.append(aString).
     8
     9        Reviewed by Timothy Hatcher.
     10
     11        * UserInterface/Base/DOMUtilities.js:
     12        * UserInterface/Base/Main.js:
     13        (WebInspector.linkifyLocation):
     14        (WebInspector.linkifyStringAsFragmentWithCustomLinkifier):
     15        * UserInterface/Models/Breakpoint.js:
     16        (WebInspector.Breakpoint.prototype._editBreakpointPopoverContentElement):
     17        * UserInterface/Views/BoxModelDetailsSectionRow.js:
     18        (WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics):
     19        * UserInterface/Views/CSSStyleDeclarationSection.js:
     20        (WebInspector.CSSStyleDeclarationSection.prototype.refresh):
     21        * UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
     22        (WebInspector.CSSStyleDetailsSidebarPanel):
     23        * UserInterface/Views/ChartDetailsSectionRow.js:
     24        (WebInspector.ChartDetailsSectionRow.prototype._createLegendItem):
     25        * UserInterface/Views/ConsoleMessageView.js:
     26        (WebInspector.ConsoleMessageView.prototype._appendMessageTextAndArguments):
     27        (WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
     28        * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
     29        (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.accessibilityPropertiesCallback):
     30        (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility):
     31        * UserInterface/Views/DOMTreeElement.js:
     32        (WebInspector.DOMTreeElement.prototype._insertInLastAttributePosition):
     33        (WebInspector.DOMTreeElement.prototype._buildAttributeDOM):
     34        (WebInspector.DOMTreeElement.prototype._buildTagDOM):
     35        (WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
     36        defaultElement variable is unused, remove it.
     37
     38        * UserInterface/Views/DataGrid.js:
     39        (WebInspector.DataGridNode.prototype.createCell.get if):
     40        (WebInspector.DataGridNode.prototype.createCell):
     41        * UserInterface/Views/DebuggerDashboardView.js:
     42        (WebInspector.DebuggerDashboardView.prototype._rebuildLocation):
     43        * UserInterface/Views/EventListenerSectionGroup.js:
     44        (WebInspector.EventListenerSectionGroup.prototype._functionTextOrLink):
     45        (WebInspector.EventListenerSectionGroup):
     46        * UserInterface/Views/FormattedValue.js:
     47        (WebInspector.FormattedValue.createLinkifiedElementString):
     48        (WebInspector.FormattedValue.createElementForNodePreview):
     49        * UserInterface/Views/ObjectPreviewView.js:
     50        (WebInspector.ObjectPreviewView.prototype._appendEntryPreviews):
     51        (WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
     52        * UserInterface/Views/ResourceDetailsSidebarPanel.js:
     53        (WebInspector.ResourceDetailsSidebarPanel.prototype._refreshRequestDataSection):
     54        (WebInspector.ResourceDetailsSidebarPanel):
     55        * UserInterface/Views/RulesStyleDetailsPanel.js:
     56        (WebInspector.RulesStyleDetailsPanel.prototype.refresh.addNewRuleButton):
     57        (WebInspector.RulesStyleDetailsPanel.prototype.refresh.insertMediaOrInheritanceLabel):
     58        * UserInterface/Views/SearchResultTreeElement.js:
     59        (WebInspector.SearchResultTreeElement.truncateAndHighlightTitle):
     60        * UserInterface/Views/SyntaxHighlightingSupport.js:
     61        (.appendText):
     62        (WebInspector.syntaxHighlightStringAsDocumentFragment):
     63        * UserInterface/Views/TimelineDataGridNode.js:
     64        (WebInspector.TimelineDataGridNode.prototype.createCellContent):
     65
    1662015-07-24  Joseph Pecoraro  <pecoraro@apple.com>
    267
  • trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js

    r173436 r187402  
    9393
    9494    var link = document.createElement("span");
    95     link.appendChild(document.createTextNode(displayName));
     95    link.append(displayName);
    9696    link.setAttribute("role", "link");
    9797    link.className = "node-link";
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r187249 r187402  
    18151815        if (className)
    18161816            anchor.className = className;
    1817         anchor.appendChild(document.createTextNode(WebInspector.displayNameForURL(url) + ":" + lineNumber));
     1817        anchor.append(WebInspector.displayNameForURL(url) + ":" + lineNumber);
    18181818        return anchor;
    18191819    }
     
    18841884        var linkIndex = string.indexOf(linkString);
    18851885        var nonLink = string.substring(0, linkIndex);
    1886         container.appendChild(document.createTextNode(nonLink));
     1886        container.append(nonLink);
    18871887
    18881888        var title = linkString;
     
    18981898
    18991899    if (string)
    1900         container.appendChild(document.createTextNode(string));
     1900        container.append(string);
    19011901
    19021902    return container;
  • trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js

    r186589 r187402  
    397397        checkboxLabel.className = "toggle";
    398398        checkboxLabel.appendChild(checkboxElement);
    399         checkboxLabel.appendChild(document.createTextNode(this._sourceCodeLocation.displayLocationString()));
     399        checkboxLabel.append(this._sourceCodeLocation.displayLocationString());
    400400
    401401        var table = document.createElement("table");
  • trunk/Source/WebInspectorUI/UserInterface/Views/BoxModelDetailsSectionRow.js

    r184925 r187402  
    217217                var widthElement = createContentAreaWidthElement.call(this, style);
    218218                var heightElement = createContentAreaHeightElement.call(this, style);
    219 
    220                 boxElement.appendChild(widthElement);
    221                 boxElement.appendChild(document.createTextNode(" \u00D7 "));
    222                 boxElement.appendChild(heightElement);
     219                boxElement.append(widthElement, " \u00D7 ", heightElement);
    223220            } else {
    224221                var suffix = (name === "border" ? "-width" : "");
  • trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js

    r186585 r187402  
    179179        this._selectorElements = [];
    180180
    181         this._originElement.appendChild(document.createTextNode(" \u2014 "));
     181        this._originElement.append(" \u2014 ");
    182182
    183183        function appendSelector(selector, matched)
     
    232232                    appendSelector.call(this, selectors[i], alwaysMatch || matchedSelectorIndices.includes(i));
    233233                    if (i < selectors.length - 1)
    234                         this._selectorElement.appendChild(document.createTextNode(", "));
     234                        this._selectorElement.append(", ");
    235235                }
    236236            } else
     
    262262                console.assert(originString);
    263263                if (originString)
    264                     this._originElement.appendChild(document.createTextNode(originString));
     264                    this._originElement.append(originString);
    265265            }
    266266
     
    269269        case WebInspector.CSSStyleDeclaration.Type.Inline:
    270270            appendSelectorTextKnownToMatch.call(this, WebInspector.displayNameForNode(this._style.node));
    271             this._originElement.appendChild(document.createTextNode(WebInspector.UIString("Style Attribute")));
     271            this._originElement.append(WebInspector.UIString("Style Attribute"));
    272272            break;
    273273
    274274        case WebInspector.CSSStyleDeclaration.Type.Attribute:
    275275            appendSelectorTextKnownToMatch.call(this, WebInspector.displayNameForNode(this._style.node));
    276             this._originElement.appendChild(document.createTextNode(WebInspector.UIString("HTML Attributes")));
     276            this._originElement.append(WebInspector.UIString("HTML Attributes"));
    277277            break;
    278278        }
  • trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDetailsSidebarPanel.js

    r185723 r187402  
    5757
    5858                labelElement.appendChild(checkboxElement);
    59                 labelElement.appendChild(document.createTextNode(label));
     59                labelElement.append(label);
    6060
    6161                if (!groupElement || groupElement.children.length === 2) {
  • trunk/Source/WebInspectorUI/UserInterface/Views/ChartDetailsSectionRow.js

    r183721 r187402  
    125125        var labelElement = document.createElement("div");
    126126        labelElement.className = "label";
    127         labelElement.appendChild(colorSwatchElement);
    128         labelElement.appendChild(document.createTextNode(item.label));
     127        labelElement.append(colorSwatchElement, item.label);
    129128
    130129        var valueElement = document.createElement("div");
  • trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js

    r187147 r187402  
    229229            case WebInspector.ConsoleMessage.MessageType.Trace:
    230230                // FIXME: We should use a better string then console.trace.
    231                 element.appendChild(document.createTextNode("console.trace()"));
     231                element.append("console.trace()");
    232232                break;
    233233
     
    257257            case WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed:
    258258                var groupName = this._message.messageText || WebInspector.UIString("Group");
    259                 element.appendChild(document.createTextNode(groupName));
     259                element.append(groupName);
    260260                this._extraParameters = null;
    261261                break;
     
    431431        } else {
    432432            var defaultMessage = WebInspector.UIString("No message");
    433             builderElement.appendChild(document.createTextNode(defaultMessage));
     433            builderElement.append(defaultMessage);
    434434        }
    435435
     
    460460            } else {
    461461                // Multiple objects. Show an indicator.
    462                 builderElement.appendChild(document.createTextNode(" "));
     462                builderElement.append(" ");
    463463                var enclosedElement = builderElement.appendChild(document.createElement("span"));
    464464                enclosedElement.classList.add("console-message-enclosed");
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js

    r183327 r187402  
    417417                        liveRegionStatusNode.className = "value-with-clarification";
    418418                        liveRegionStatusNode.setAttribute("role", "text");
    419                         liveRegionStatusNode.appendChild(document.createTextNode(liveRegionStatus));
     419                        liveRegionStatusNode.append(liveRegionStatus);
    420420                        var clarificationNode = document.createElement("div");
    421421                        clarificationNode.className = "clarification";
    422                         clarificationNode.appendChild(document.createTextNode(WebInspector.UIString("Region announced in its entirety.")));
     422                        clarificationNode.append(WebInspector.UIString("Region announced in its entirety."));
    423423                        liveRegionStatusNode.appendChild(clarificationNode);
    424424                    }
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js

    r184824 r187402  
    563563            var nodeName = tag.textContent.match(/^<(.*?)>$/)[1];
    564564            tag.textContent = "";
    565             tag.appendChild(document.createTextNode("<" + nodeName));
    566             tag.appendChild(node);
    567             tag.appendChild(document.createTextNode(">"));
     565            tag.append("<" + nodeName, node, ">");
    568566        }
    569567
     
    10461044
    10471045        if (hasText)
    1048             attrSpanElement.appendChild(document.createTextNode("=\u200B\""));
     1046            attrSpanElement.append("=\u200B\"");
    10491047
    10501048        if (name === "src" || name === "href") {
     
    10741072
    10751073        if (hasText)
    1076             attrSpanElement.appendChild(document.createTextNode("\""));
     1074            attrSpanElement.append("\"");
    10771075    }
    10781076
     
    10861084            classes.push("shadow");
    10871085        var tagElement = parentElement.createChild("span", classes.join(" "));
    1088         tagElement.appendChild(document.createTextNode("<"));
     1086        tagElement.append("<");
    10891087        var tagNameElement = tagElement.createChild("span", isClosingTag ? "" : "html-tag-name");
    10901088        tagNameElement.textContent = (isClosingTag ? "/" : "") + tagName;
     
    10931091            for (var i = 0; i < attributes.length; ++i) {
    10941092                var attr = attributes[i];
    1095                 tagElement.appendChild(document.createTextNode(" "));
     1093                tagElement.append(" ");
    10961094                this._buildAttributeDOM(tagElement, attr.name, attr.value, node);
    10971095            }
    10981096        }
    1099         tagElement.appendChild(document.createTextNode(">"));
    1100         parentElement.appendChild(document.createTextNode("\u200B"));
     1097        tagElement.append(">");
     1098        parentElement.append("\u200B");
    11011099    }
    11021100
     
    11451143                        var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
    11461144                        textNodeElement.textContent = "\u2026";
    1147                         info.titleDOM.appendChild(document.createTextNode("\u200B"));
     1145                        info.titleDOM.append("\u200B");
    11481146                    }
    11491147                    this._buildTagDOM(info.titleDOM, tagName, true, false);
     
    11641162                        textNodeElement.textContent = textChild.nodeValue();
    11651163
    1166                     info.titleDOM.appendChild(document.createTextNode("\u200B"));
     1164                    info.titleDOM.append("\u200B");
    11671165
    11681166                    this._buildTagDOM(info.titleDOM, tagName, true, false);
     
    11791177                    newNode.appendChild(WebInspector.syntaxHighlightStringAsDocumentFragment(trimedNodeValue(), "text/css"));
    11801178                } else {
    1181                     info.titleDOM.appendChild(document.createTextNode("\""));
     1179                    info.titleDOM.append("\"");
    11821180                    var textNodeElement = info.titleDOM.createChild("span", "html-text-node");
    11831181                    textNodeElement.textContent = node.nodeValue();
    1184                     info.titleDOM.appendChild(document.createTextNode("\""));
     1182                    info.titleDOM.append("\"");
    11851183                }
    11861184                break;
     
    11881186            case Node.COMMENT_NODE:
    11891187                var commentElement = info.titleDOM.createChild("span", "html-comment");
    1190                 commentElement.appendChild(document.createTextNode("<!--" + node.nodeValue() + "-->"));
     1188                commentElement.append("<!--" + node.nodeValue() + "-->");
    11911189                break;
    11921190
    11931191            case Node.DOCUMENT_TYPE_NODE:
    11941192                var docTypeElement = info.titleDOM.createChild("span", "html-doctype");
    1195                 docTypeElement.appendChild(document.createTextNode("<!DOCTYPE " + node.nodeName()));
     1193                docTypeElement.append("<!DOCTYPE " + node.nodeName());
    11961194                if (node.publicId) {
    1197                     docTypeElement.appendChild(document.createTextNode(" PUBLIC \"" + node.publicId + "\""));
     1195                    docTypeElement.append(" PUBLIC \"" + node.publicId + "\"");
    11981196                    if (node.systemId)
    1199                         docTypeElement.appendChild(document.createTextNode(" \"" + node.systemId + "\""));
     1197                        docTypeElement.append(" \"" + node.systemId + "\"");
    12001198                } else if (node.systemId)
    1201                     docTypeElement.appendChild(document.createTextNode(" SYSTEM \"" + node.systemId + "\""));
     1199                    docTypeElement.append(" SYSTEM \"" + node.systemId + "\"");
    12021200
    12031201                if (node.internalSubset)
    1204                     docTypeElement.appendChild(document.createTextNode(" [" + node.internalSubset + "]"));
    1205 
    1206                 docTypeElement.appendChild(document.createTextNode(">"));
     1202                    docTypeElement.append(" [" + node.internalSubset + "]");
     1203
     1204                docTypeElement.append(">");
    12071205                break;
    12081206
    12091207            case Node.CDATA_SECTION_NODE:
    12101208                var cdataElement = info.titleDOM.createChild("span", "html-text-node");
    1211                 cdataElement.appendChild(document.createTextNode("<![CDATA[" + node.nodeValue() + "]]>"));
     1209                cdataElement.append("<![CDATA[" + node.nodeValue() + "]]>");
    12121210                break;
    12131211
     
    12171215                var dataString = data.length ? " " + data : "";
    12181216                var title = "<?" + node.nodeNameInCorrectCase() + dataString + "?>";
    1219                 processingInstructionElement.appendChild(document.createTextNode(title));
     1217                processingInstructionElement.append(title);
    12201218                break;
    12211219
    12221220            default:
    1223                 var defaultElement = info.titleDOM.appendChild(document.createTextNode(node.nodeNameInCorrectCase().collapseWhitespace()));
     1221                info.titleDOM.append(node.nodeNameInCorrectCase().collapseWhitespace());
    12241222        }
    12251223
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js

    r186306 r187402  
    15791579        var div = cellElement.createChild("div");
    15801580        var content = this.createCellContent(columnIdentifier, cellElement);
    1581         div.appendChild(content instanceof Node ? content : document.createTextNode(content));
     1581        div.append(content);
    15821582
    15831583        if (columnIdentifier === this.dataGrid.disclosureColumnIdentifier) {
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerDashboardView.js

    r184819 r187402  
    8585
    8686        var nameElement = document.createElement("div");
    87         nameElement.appendChild(document.createTextNode(functionName));
     87        nameElement.append(functionName);
    8888        nameElement.classList.add("function-name");
    8989        this._locationElement.appendChild(nameElement);
  • trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js

    r182040 r187402  
    9696
    9797        var fragment = document.createDocumentFragment();
    98         fragment.appendChild(linkElement);
    99         fragment.appendChild(document.createTextNode(functionName));
     98        fragment.append(linkElement, functionName);
    10099        return fragment;
    101100    }
  • trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js

    r185716 r187402  
    4040    var span = document.createElement("span");
    4141    span.className = "formatted-string";
    42     span.appendChild(document.createTextNode("\""));
    43     span.appendChild(WebInspector.linkifyStringAsFragment(string.replace(/"/g, "\\\"")));
    44     span.appendChild(document.createTextNode("\""));
     42    span.append("\"", WebInspector.linkifyStringAsFragment(string.replace(/"/g, "\\\"")), "\"");
    4543    return span;
    4644};
     
    103101    var tag = document.createElement("span");
    104102    tag.className = "html-tag";
    105     tag.appendChild(document.createTextNode("<"));
     103    tag.append("<");
    106104
    107105    var tagName = tag.appendChild(document.createElement("span"));
     
    110108
    111109    if (matches[2]) {
    112         tag.appendChild(document.createTextNode(" "));
     110        tag.append(" ");
    113111        var attribute = tag.appendChild(document.createElement("span"));
    114112        attribute.className = "html-attribute";
     
    116114        attributeName.className = "html-attribute-name";
    117115        attributeName.textContent = matches[2];
    118         attribute.appendChild(document.createTextNode("=\""));
     116        attribute.append("=\"");
    119117        var attributeValue = attribute.appendChild(document.createElement("span"));
    120118        attributeValue.className = "html-attribute-value";
    121119        attributeValue.textContent = matches[3];
    122         attribute.appendChild(document.createTextNode("\""));
    123     }
    124 
    125     tag.appendChild(document.createTextNode(">"));
     120        attribute.append("\"");
     121    }
     122
     123    tag.append(">");
    126124    span.appendChild(tag);
    127125
  • trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js

    r186634 r187402  
    153153        var isIterator = preview.subtype === "iterator";
    154154
    155         element.appendChild(document.createTextNode(isIterator ? "[" : "{"));
     155        element.append(isIterator ? "[" : "{");
    156156
    157157        var limit = Math.min(preview.collectionEntryPreviews.length, this._numberOfPropertiesToShowInMode());
    158158        for (var i = 0; i < limit; ++i) {
    159159            if (i > 0)
    160                 element.appendChild(document.createTextNode(", "));
     160                element.append(", ");
    161161
    162162            var keyPreviewLossless = true;
     
    164164            if (entry.keyPreview) {
    165165                keyPreviewLossless = this._appendPreview(element, entry.keyPreview);
    166                 element.appendChild(document.createTextNode(" => "));
     166                element.append(" => ");
    167167            }
    168168
     
    179179
    180180        if (overflow)
    181             element.appendChild(document.createTextNode(", \u2026"));
    182         element.appendChild(document.createTextNode(isIterator ? "]" : "}"));
     181            element.append(", \u2026");
     182        element.append(isIterator ? "]" : "}");
    183183
    184184        return lossless;
     
    201201        var isArray = preview.subtype === "array";
    202202
    203         element.appendChild(document.createTextNode(isArray ? "[" : "{"));
     203        element.append(isArray ? "[" : "{");
    204204
    205205        var numberAdded = 0;
     
    217217
    218218            if (numberAdded++ > 0)
    219                 element.appendChild(document.createTextNode(", "));
     219                element.append(", ");
    220220
    221221            if (!isArray || property.name != i) {
     
    223223                nameElement.className = "name";
    224224                nameElement.textContent = property.name;
    225                 element.appendChild(document.createTextNode(": "));
     225                element.append(": ");
    226226            }
    227227
     
    240240
    241241        if (overflow)
    242             element.appendChild(document.createTextNode(", \u2026"));
    243         element.appendChild(document.createTextNode(isArray ? "]" : "}"));
     242            element.append(", \u2026");
     243        element.append(isArray ? "]" : "}");
    244244
    245245        return lossless;
  • trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js

    r183331 r187402  
    460460        var dataValue = document.createDocumentFragment();
    461461
    462         dataValue.appendChild(document.createTextNode(sizeValue));
     462        dataValue.append(sizeValue);
    463463
    464464        var goToButton = dataValue.appendChild(WebInspector.createGoToArrowButton());
  • trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js

    r187195 r187402  
    171171                newRuleButton.addEventListener("click", this._newRuleClicked.bind(this));
    172172
    173                 newRuleButton.appendChild(document.createElement("img"));
    174                 newRuleButton.appendChild(document.createTextNode(WebInspector.UIString("New Rule")));
     173                newRuleButton.append(document.createElement("img"), WebInspector.UIString("New Rule"));
    175174
    176175                newDOMFragment.appendChild(newRuleButton);
     
    218217                    var mediaLabel = document.createElement("div");
    219218                    mediaLabel.className = "label";
    220                     mediaLabel.appendChild(prefixElement);
    221                     mediaLabel.appendChild(document.createTextNode(media.text));
    222 
    223                     if (media.sourceCodeLocation) {
    224                         mediaLabel.appendChild(document.createTextNode(" \u2014 "));
    225                         mediaLabel.appendChild(WebInspector.createSourceCodeLocationLink(media.sourceCodeLocation, true));
    226                     }
     219                    mediaLabel.append(prefixElement, media.text);
     220
     221                    if (media.sourceCodeLocation)
     222                        mediaLabel.append(" \u2014 ", WebInspector.createSourceCodeLocationLink(media.sourceCodeLocation, true));
    227223
    228224                    newDOMFragment.appendChild(mediaLabel);
     
    241237                    var mediaLabel = document.createElement("div");
    242238                    mediaLabel.className = "label";
    243                     mediaLabel.appendChild(prefixElement);
    244                     mediaLabel.appendChild(document.createTextNode("all"));
     239                    mediaLabel.append(prefixElement, "all");
    245240
    246241                    newDOMFragment.appendChild(mediaLabel);
  • trunk/Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js

    r182042 r187402  
    6565        var highlightedTitle = document.createDocumentFragment();
    6666
    67         highlightedTitle.appendChild(document.createTextNode(modifiedTitle.substring(0, searchTermIndex)));
     67        highlightedTitle.append(modifiedTitle.substring(0, searchTermIndex));
    6868
    6969        var highlightSpan = document.createElement("span");
    7070        highlightSpan.className = "highlighted";
    71         highlightSpan.appendChild(document.createTextNode(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length)));
     71        highlightSpan.append(modifiedTitle.substring(searchTermIndex, searchTermIndex + searchTerm.length));
    7272        highlightedTitle.appendChild(highlightSpan);
    7373
    74         highlightedTitle.appendChild(document.createTextNode(modifiedTitle.substring(searchTermIndex + searchTerm.length)));
     74        highlightedTitle.append(modifiedTitle.substring(searchTermIndex + searchTerm.length));
    7575
    7676        return highlightedTitle;
  • trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingSupport.js

    r164543 r187402  
    3333    {
    3434        if (!style) {
    35             resultFragment.appendChild(document.createTextNode(text));
     35            resultFragment.append(text);
    3636            return;
    3737        }
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js

    r186119 r187402  
    188188                    cell.classList.add(WebInspector.CallFrameView.FunctionIconStyleClassName);
    189189
    190                     fragment.appendChild(document.createTextNode(functionName));
     190                    fragment.append(functionName);
    191191
    192192                    var subtitleElement = document.createElement("span");
     
    202202            var icon = document.createElement("div");
    203203            icon.className = WebInspector.LayoutTimelineDataGridNode.IconStyleClassName;
    204             fragment.appendChild(icon);
    205 
    206             fragment.appendChild(document.createTextNode(functionName));
     204
     205            fragment.append(icon, functionName);
    207206
    208207            return fragment;
Note: See TracChangeset for help on using the changeset viewer.