<!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>[188483] trunk/Source/WebInspectorUI</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/188483">188483</a></dd>
<dt>Author</dt> <dd>drousso@apple.com</dd>
<dt>Date</dt> <dd>2015-08-14 13:05:06 -0700 (Fri, 14 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Add Visual editors for CSS properties with comma separated values
https://bugs.webkit.org/show_bug.cgi?id=147578

Reviewed by Timothy Hatcher.

Displays comma separated CSS property values as a tree outline list.

* UserInterface/Images/Minus.svg: Added.
* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline.prototype.get selectedTreeElementIndex):
(WebInspector.TreeOutline):

* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css: Added.
(.visual-style-property-container.comma-separated-keyword-editor):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item:nth-child(odd)):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.selected):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; :matches(button, img)):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; .titles):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item.selected:not(.editor-hidden) &gt; .titles &gt; *):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item &gt; .visual-style-comma-separated-keyword-item-editor):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item.editor-hidden &gt; .visual-style-comma-separated-keyword-item-editor):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; .titles &gt; .subtitle):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item:not(.no-value) &gt; .titles &gt; .subtitle):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls &gt; div):
(.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls &gt; .visual-style-remove-comma-separated-keyword):

* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js: Added.
(WebInspector.VisualStyleCommaSeparatedKeywordEditor):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.set selectedTreeElementValue):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.get value):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.set value):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.get synthesizedValue):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._treeElementSelected):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._treeItemIsEmpty):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._addEmptyCommaSeparatedKeyword):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._removeSelectedCommaSeparatedKeyword):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._removeEmptyCommaSeparatedKeywords):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._addCommaSeparatedKeyword):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._removeCommaSeparatedKeyword):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._createNewTreeElement):

* UserInterface/Views/VisualStyleFontFamilyListEditor.js: Added.
(WebInspector.VisualStyleFontFamilyListEditor):
(WebInspector.VisualStyleFontFamilyListEditor.prototype.visualStyleCompletionsControllerCustomizeCompletionElement):
(WebInspector.VisualStyleFontFamilyListEditor.prototype.get hasCompletions):
(WebInspector.VisualStyleFontFamilyListEditor.prototype.set completions):
(WebInspector.VisualStyleFontFamilyListEditor.prototype._modifyCommaSeparatedKeyword):
(WebInspector.VisualStyleFontFamilyListEditor.prototype._addCommaSeparatedKeyword):
(WebInspector.VisualStyleFontFamilyListEditor.prototype._addEmptyCommaSeparatedKeyword):
(WebInspector.VisualStyleFontFamilyListEditor.prototype._completionClicked):
(WebInspector.VisualStyleFontFamilyListEditor.prototype._treeElementKeyDown):
(WebInspector.VisualStyleFontFamilyListEditor.prototype._treeElementKeywordChanged):
(WebInspector.VisualStyleFontFamilyListEditor.prototype._hideCompletions):
(WebInspector.VisualStyleFontFamilyListEditor.prototype._createNewTreeElement):

* UserInterface/Views/VisualStyleFontFamilyTreeElement.js: Added.
(WebInspector.VisualStyleFontFamilyTreeElement):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype.editorBounds):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype.updateMainTitle):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype.showKeywordEditor):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype.hideKeywordEditor):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype.get keywordEditorHidden):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype.onattach):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype.ondeselect):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype._keywordEditorKeyDown):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype._keywordEditorKeyUp):
(WebInspector.VisualStyleFontFamilyTreeElement.prototype._keywordEditorBlurred):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlinejs">trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesMinussvg">trunk/Source/WebInspectorUI/UserInterface/Images/Minus.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleCommaSeparatedKeywordEditorcss">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleCommaSeparatedKeywordEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleFontFamilyListEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyListEditor.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleFontFamilyTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyTreeElement.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (188482 => 188483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-08-14 19:15:27 UTC (rev 188482)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-08-14 20:05:06 UTC (rev 188483)
</span><span class="lines">@@ -1,5 +1,79 @@
</span><span class="cx"> 2015-08-14  Devin Rousso  &lt;drousso@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Web Inspector: Add Visual editors for CSS properties with comma separated values
+        https://bugs.webkit.org/show_bug.cgi?id=147578
+
+        Reviewed by Timothy Hatcher.
+
+        Displays comma separated CSS property values as a tree outline list.
+
+        * UserInterface/Images/Minus.svg: Added.
+        * UserInterface/Views/TreeOutline.js:
+        (WebInspector.TreeOutline.prototype.get selectedTreeElementIndex):
+        (WebInspector.TreeOutline):
+
+        * UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css: Added.
+        (.visual-style-property-container.comma-separated-keyword-editor):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item:nth-child(odd)):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.selected):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; :matches(button, img)):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; .titles):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item.selected:not(.editor-hidden) &gt; .titles &gt; *):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item &gt; .visual-style-comma-separated-keyword-item-editor):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item.editor-hidden &gt; .visual-style-comma-separated-keyword-item-editor):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; .titles &gt; .subtitle):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item:not(.no-value) &gt; .titles &gt; .subtitle):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls &gt; div):
+        (.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls &gt; .visual-style-remove-comma-separated-keyword):
+
+        * UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js: Added.
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.set selectedTreeElementValue):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.get value):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.set value):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.get synthesizedValue):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._treeElementSelected):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._treeItemIsEmpty):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._addEmptyCommaSeparatedKeyword):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._removeSelectedCommaSeparatedKeyword):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._removeEmptyCommaSeparatedKeywords):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._addCommaSeparatedKeyword):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._removeCommaSeparatedKeyword):
+        (WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._createNewTreeElement):
+
+        * UserInterface/Views/VisualStyleFontFamilyListEditor.js: Added.
+        (WebInspector.VisualStyleFontFamilyListEditor):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype.visualStyleCompletionsControllerCustomizeCompletionElement):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype.get hasCompletions):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype.set completions):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype._modifyCommaSeparatedKeyword):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype._addCommaSeparatedKeyword):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype._addEmptyCommaSeparatedKeyword):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype._completionClicked):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype._treeElementKeyDown):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype._treeElementKeywordChanged):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype._hideCompletions):
+        (WebInspector.VisualStyleFontFamilyListEditor.prototype._createNewTreeElement):
+
+        * UserInterface/Views/VisualStyleFontFamilyTreeElement.js: Added.
+        (WebInspector.VisualStyleFontFamilyTreeElement):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype.editorBounds):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype.updateMainTitle):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype.showKeywordEditor):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype.hideKeywordEditor):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype.get keywordEditorHidden):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype.onattach):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype.ondeselect):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype._keywordEditorKeyDown):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype._keywordEditorKeyUp):
+        (WebInspector.VisualStyleFontFamilyTreeElement.prototype._keywordEditorBlurred):
+
+2015-08-14  Devin Rousso  &lt;drousso@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: Add autocomplete controller for Visual property editors
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=147579
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesMinussvg"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Images/Minus.svg (0 => 188483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/Minus.svg                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/Minus.svg        2015-08-14 20:05:06 UTC (rev 188483)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+&lt;!-- Copyright © 2015 Apple Inc. All rights reserved. --&gt;
+&lt;svg version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 13 13&quot;&gt;
+    &lt;line class=&quot;stroked&quot; fill=&quot;none&quot; stroke=&quot;black&quot; x1=&quot;1.5&quot; y1=&quot;6.5&quot; x2=&quot;11.5&quot; y2=&quot;6.5&quot;/&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsTreeOutlinejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (188482 => 188483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js        2015-08-14 19:15:27 UTC (rev 188482)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js        2015-08-14 20:05:06 UTC (rev 188483)
</span><span class="lines">@@ -504,6 +504,19 @@
</span><span class="cx">     {
</span><span class="cx">         // this is the root, do nothing
</span><span class="cx">     }
</span><ins>+
+    get selectedTreeElementIndex()
+    {
+        if (!this.hasChildren || !this.selectedTreeElement)
+            return;
+
+        for (var i = 0; i &lt; this.children.length; ++i) {
+            if (this.children[i] === this.selectedTreeElement)
+                return i;
+        }
+
+        return false;
+    }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.TreeOutline._knownTreeElementNextIdentifier = 1;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleCommaSeparatedKeywordEditorcss"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css (0 => 188483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css        2015-08-14 20:05:06 UTC (rev 188483)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+.visual-style-property-container.comma-separated-keyword-editor {
+    margin-bottom: 5px;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container {
+    border: 1px solid hsl(0, 0%, 83%);
+    overflow: auto;
+    font-size: 11px;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list {
+    min-height: 51px;
+    max-height: 94px;
+    margin: 0;
+    padding: 0;
+    background-color: hsl(0, 0%, 95%);
+    overflow: auto;
+    outline: none;
+    list-style-type: none;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item {
+    position: relative;
+    width: 100%;
+    height: 17px;
+    line-height: 17px;
+    overflow: hidden;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item:nth-child(odd) {
+    background-color: white;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.selected {
+    background-color: hsl(213, 92%, 55%) !important;
+    color: white;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; :matches(button, img) {
+    display: none;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; .titles {
+    padding-left: 3px;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item.selected:not(.editor-hidden) &gt; .titles &gt; * {
+    color: transparent;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item &gt; .visual-style-comma-separated-keyword-item-editor {
+    position: absolute;
+    top: 0;
+    right: 3px;
+    bottom: 0;
+    left: 3px;
+    margin: 0;
+    padding: 0;
+    line-height: 13px;
+    border: none;
+    background-color: transparent;
+    font-family: inherit;
+    color: white;
+    z-index: 1;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item.visual-style-font-family-list-item.editor-hidden &gt; .visual-style-comma-separated-keyword-item-editor {
+    display: none;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item &gt; .titles &gt; .subtitle {
+    font-size: 9px;
+    color: hsl(0, 0%, 83%);
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-list &gt; .visual-style-comma-separated-keyword-item:not(.no-value) &gt; .titles &gt; .subtitle {
+    display: none;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls {
+    display: flex;
+    border-top: 1px solid hsl(0, 0%, 83%);
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls &gt; div {
+    width: 20px;
+    height: 19px;
+    padding: 4px;
+    border-right: 1px solid hsl(0, 0%, 83%);
+    opacity: 0.7;
+}
+
+.visual-style-property-container.comma-separated-keyword-editor &gt; .visual-style-property-value-container &gt; .visual-style-comma-separated-keyword-controls &gt; .visual-style-remove-comma-separated-keyword {
+    order: 2;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleCommaSeparatedKeywordEditorjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js (0 => 188483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js        2015-08-14 20:05:06 UTC (rev 188483)
</span><span class="lines">@@ -0,0 +1,185 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.VisualStyleCommaSeparatedKeywordEditor = class VisualStyleCommaSeparatedKeywordEditor extends WebInspector.VisualStylePropertyEditor
+{
+    constructor(propertyNames, text, insertNewItemsBeforeSelected, layoutReversed)
+    {
+        super(propertyNames, text, null, null, &quot;comma-separated-keyword-editor&quot;, layoutReversed);
+
+        this._insertNewItemsBeforeSelected = insertNewItemsBeforeSelected || false;
+
+        let listElement = document.createElement(&quot;ol&quot;);
+        listElement.classList.add(&quot;visual-style-comma-separated-keyword-list&quot;);
+        this.contentElement.appendChild(listElement);
+
+        this._commaSeparatedKeywords = new WebInspector.TreeOutline(listElement);
+        this._commaSeparatedKeywords.onselect = this._treeElementSelected.bind(this);
+
+        let controlContainer = document.createElement(&quot;div&quot;);
+        controlContainer.classList.add(&quot;visual-style-comma-separated-keyword-controls&quot;);
+        this.contentElement.appendChild(controlContainer);
+
+        wrappedSVGDocument(&quot;Images/Plus.svg&quot;, &quot;visual-style-add-comma-separated-keyword&quot;, WebInspector.UIString(&quot;Click to add a new item.&quot;), function(wrapper) {
+            wrapper.addEventListener(&quot;click&quot;, this._addEmptyCommaSeparatedKeyword.bind(this));
+            controlContainer.appendChild(wrapper);
+        }.bind(this));
+
+        wrappedSVGDocument(&quot;Images/Minus.svg&quot;, &quot;visual-style-remove-comma-separated-keyword&quot;, WebInspector.UIString(&quot;Click to remove the selected item.&quot;), function(wrapper) {
+            wrapper.addEventListener(&quot;click&quot;, this._removeSelectedCommaSeparatedKeyword.bind(this));
+            controlContainer.appendChild(wrapper);
+        }.bind(this));
+    }
+
+    // Public
+
+    set selectedTreeElementValue(text)
+    {
+        let selectedTreeElement = this._commaSeparatedKeywords.selectedTreeElement;
+        if (!selectedTreeElement)
+            return;
+
+        selectedTreeElement.element.classList.toggle(&quot;no-value&quot;, !text || !text.length);
+        selectedTreeElement.mainTitle = text;
+        this._valueDidChange();
+    }
+
+    get value()
+    {
+        if (!this._commaSeparatedKeywords.hasChildren)
+            return;
+
+        let value = &quot;&quot;;
+        for (let treeItem of this._commaSeparatedKeywords.children) {
+            if (this._treeElementIsEmpty(treeItem))
+                continue;
+
+            if (value.length)
+                value += &quot;, &quot;;
+
+            let text = treeItem.mainTitle;
+            if (typeof this._modifyCommaSeparatedKeyword === &quot;function&quot;)
+                text = this._modifyCommaSeparatedKeyword(text);
+
+            value += text;
+        }
+
+        return value;
+    }
+
+    set value(commaSeparatedValue)
+    {
+        if (commaSeparatedValue &amp;&amp; commaSeparatedValue === this.value)
+            return;
+
+        this._commaSeparatedKeywords.removeChildren();
+        if (!commaSeparatedValue || !commaSeparatedValue.length) {
+            this.dispatchEventToListeners(WebInspector.VisualStyleCommaSeparatedKeywordEditor.Event.NoRemainingTreeItems);
+            return;
+        }
+
+        let values = commaSeparatedValue.split(/\s*,\s*(?![^\(]*\))/);
+        for (let value of values)
+            this._addCommaSeparatedKeyword(value);
+
+        this._commaSeparatedKeywords.children[0].select(true);
+    }
+
+    get synthesizedValue()
+    {
+        return this.value || null;
+    }
+
+    // Private
+
+    _treeElementSelected(item, selectedByUser)
+    {
+        this._removeEmptyCommaSeparatedKeywords();
+        this.dispatchEventToListeners(WebInspector.VisualStyleCommaSeparatedKeywordEditor.Event.TreeItemSelected, {text: item.mainTitle});
+    }
+
+    _treeElementIsEmpty(item)
+    {
+        return !item._mainTitle || !item._mainTitle.length;
+    }
+
+    _addEmptyCommaSeparatedKeyword()
+    {
+        let newTreeElement = this._addCommaSeparatedKeyword(null, this._commaSeparatedKeywords.selectedTreeElementIndex);
+        newTreeElement.subtitle = WebInspector.UIString(&quot;(modify the boxes below to add a value)&quot;);
+        newTreeElement.element.classList.add(&quot;no-value&quot;);
+        newTreeElement.select(true, true);
+        return newTreeElement;
+    }
+
+    _removeSelectedCommaSeparatedKeyword()
+    {
+        let selectedTreeElement = this._commaSeparatedKeywords.selectedTreeElement;
+        this._removeCommaSeparatedKeyword(selectedTreeElement);
+    }
+
+    _removeEmptyCommaSeparatedKeywords()
+    {
+        for (let treeElement of this._commaSeparatedKeywords.children) {
+            if (!this._treeElementIsEmpty(treeElement) || treeElement.selected)
+                continue;
+
+            treeElement.deselect();
+            this._removeCommaSeparatedKeyword(treeElement);
+        }
+    }
+
+    _addCommaSeparatedKeyword(value, index)
+    {
+        let valueElement = this._createNewTreeElement(value);
+        let indexIsSet = !isNaN(index);
+        this._commaSeparatedKeywords.insertChild(valueElement, indexIsSet ? index + !this._insertNewItemsBeforeSelected : 0);
+        return valueElement;
+    }
+
+    _removeCommaSeparatedKeyword(treeElement)
+    {
+        if (!treeElement)
+            return;
+
+        this._commaSeparatedKeywords.removeChild(treeElement);
+        if (!this._commaSeparatedKeywords.children.length)
+            this.dispatchEventToListeners(WebInspector.VisualStyleCommaSeparatedKeywordEditor.Event.NoRemainingTreeItems);
+
+        this._valueDidChange();
+    }
+
+    _createNewTreeElement(value)
+    {
+        return new WebInspector.GeneralTreeElement(WebInspector.VisualStyleCommaSeparatedKeywordEditor.ListItemClassName, value);
+    }
+};
+
+WebInspector.VisualStyleCommaSeparatedKeywordEditor.ListItemClassName = &quot;visual-style-comma-separated-keyword-item&quot;;
+
+WebInspector.VisualStyleCommaSeparatedKeywordEditor.Event = {
+    TreeItemSelected: &quot;visual-style-comma-separated-keyword-editor-tree-item-selected&quot;,
+    NoRemainingTreeItems: &quot;visual-style-comma-separated-keyword-editor-no-remaining-tree-items&quot;
+}
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleFontFamilyListEditorjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyListEditor.js (0 => 188483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyListEditor.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyListEditor.js        2015-08-14 20:05:06 UTC (rev 188483)
</span><span class="lines">@@ -0,0 +1,158 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.VisualStyleFontFamilyListEditor = class VisualStyleFontFamilyListEditor extends WebInspector.VisualStyleCommaSeparatedKeywordEditor
+{
+    constructor(propertyNames, text, layoutReversed)
+    {
+        super(propertyNames, text, true, layoutReversed);
+
+        this._commaSeparatedKeywords.element.addEventListener(&quot;scroll&quot;, this._hideCompletions.bind(this));
+
+        this._completionController = new WebInspector.VisualStyleCompletionsController(this);
+        this._completionController.addEventListener(WebInspector.VisualStyleCompletionsController.Event.CompletionSelected, this._completionClicked, this);
+
+        this._wrapWithQuotesRegExp = /^[a-zA-Z\-]+$/;
+        this._removeWrappedQuotesRegExp = /[\&quot;\']/g;
+    }
+
+    // Public
+
+    visualStyleCompletionsControllerCustomizeCompletionElement(suggestionsView, element, item)
+    {
+        element.style.fontFamily = item;
+    }
+
+    get hasCompletions()
+    {
+        return this._completionController.hasCompletions;
+    }
+
+    set completions(completions)
+    {
+        this._completionController.completions = completions;
+    }
+
+    // Private
+
+    _modifyCommaSeparatedKeyword(text)
+    {
+        if (!this._wrapWithQuotesRegExp.test(text))
+            text = &quot;\&quot;&quot; + text + &quot;\&quot;&quot;;
+
+        return text;
+    }
+
+    _addCommaSeparatedKeyword(value, index)
+    {
+        if (value)
+            value = value.replace(this._removeWrappedQuotesRegExp, &quot;&quot;);
+
+        let valueElement = super._addCommaSeparatedKeyword(value, index);
+        valueElement.addEventListener(WebInspector.VisualStyleFontFamilyTreeElement.Event.EditorKeyDown, this._treeElementKeyDown, this);
+        valueElement.addEventListener(WebInspector.VisualStyleFontFamilyTreeElement.Event.KeywordChanged, this._treeElementKeywordChanged, this);
+        valueElement.addEventListener(WebInspector.VisualStyleFontFamilyTreeElement.Event.EditorBlurred, this._hideCompletions, this);
+        return valueElement;
+    }
+
+    _addEmptyCommaSeparatedKeyword()
+    {
+        let newItem = super._addEmptyCommaSeparatedKeyword();
+        newItem.showKeywordEditor();
+    }
+
+    _completionClicked(event)
+    {
+        this.value = event.data.text;
+        this._valueDidChange();
+    }
+
+    _treeElementKeyDown(event)
+    {
+        if (!this._completionController.visible)
+            return;
+
+        let key = event &amp;&amp; event.data &amp;&amp; event.data.key;
+        if (!key)
+            return;
+
+        if (key === &quot;Enter&quot; || key === &quot;Tab&quot;) {
+            let selectedTreeElement = this._commaSeparatedKeywords.selectedTreeElement;
+            if (!selectedTreeElement)
+                return;
+
+            selectedTreeElement.updateMainTitle(this._completionController.currentCompletion);
+            this._completionController.hide();
+            return;
+        }
+
+        if (key === &quot;Escape&quot;) {
+            this._hideCompletions();
+            return;
+        }
+
+        if (key === &quot;Up&quot;) {
+            this._completionController.previous();
+            return;
+        }
+
+        if (key === &quot;Down&quot;) {
+            this._completionController.next();
+            return;
+        }
+    }
+
+    _treeElementKeywordChanged()
+    {
+        if (!this.hasCompletions)
+            return;
+
+        let result = this._valueDidChange();
+        if (!result)
+            return;
+
+        let treeElement = this._commaSeparatedKeywords.selectedTreeElement;
+        if (!treeElement)
+            return;
+
+        if (this._completionController.update(treeElement.mainTitle)) {
+            let bounds = treeElement.editorBounds(2);
+            if (!bounds)
+                return;
+
+            this._completionController.show(bounds);
+        }
+    }
+
+    _hideCompletions()
+    {
+        this._completionController.hide();
+    }
+
+    _createNewTreeElement(value)
+    {
+        return new WebInspector.VisualStyleFontFamilyTreeElement(value);
+    }
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleFontFamilyTreeElementjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyTreeElement.js (0 => 188483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyTreeElement.js                                (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleFontFamilyTreeElement.js        2015-08-14 20:05:06 UTC (rev 188483)
</span><span class="lines">@@ -0,0 +1,167 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.VisualStyleFontFamilyTreeElement = class VisualStyleFontFamilyTreeElement extends WebInspector.GeneralTreeElement
+{
+    constructor(text)
+    {
+        super([WebInspector.VisualStyleCommaSeparatedKeywordEditor.ListItemClassName, &quot;visual-style-font-family-list-item&quot;], text);
+
+        this._keywordEditor = document.createElement(&quot;input&quot;);
+        this._keywordEditor.classList.add(&quot;visual-style-comma-separated-keyword-item-editor&quot;);
+        this._keywordEditor.placeholder = WebInspector.UIString(&quot;(modify the boxes below to add a value)&quot;);
+        this._keywordEditor.spellcheck = false;
+        this._keywordEditor.addEventListener(&quot;keydown&quot;, this._keywordEditorKeyDown.bind(this));
+        this._keywordEditor.addEventListener(&quot;keyup&quot;, this._keywordEditorKeyUp.bind(this));
+        this._keywordEditor.addEventListener(&quot;blur&quot;, this._keywordEditorBlurred.bind(this));
+    }
+
+    // Public
+
+    editorBounds(padding)
+    {
+        if (this.keywordEditorHidden)
+            return;
+
+        let bounds = WebInspector.Rect.rectFromClientRect(this._keywordEditor.getBoundingClientRect());
+        return bounds.pad(padding || 0);
+    }
+
+    updateMainTitle(text)
+    {
+        this.mainTitle = this._listItemNode.style.fontFamily = this._keywordEditor.value = text;
+
+        let hasText = text &amp;&amp; text.length;
+        this._listItemNode.classList.toggle(&quot;no-value&quot;, !hasText);
+        if (!hasText)
+            this.subtitle = this._keywordEditor.placeholder;
+
+        this.dispatchEventToListeners(WebInspector.VisualStyleFontFamilyTreeElement.Event.KeywordChanged);
+    }
+
+    showKeywordEditor()
+    {
+        if (!this.keywordEditorHidden)
+            return;
+
+        this.subtitle = &quot;&quot;;
+        this._listItemNode.classList.remove(&quot;editor-hidden&quot;);
+        this._listItemNode.scrollIntoViewIfNeeded();
+
+        this._keywordEditor.value = this._mainTitle;
+        this._keywordEditor.select();
+    }
+
+    hideKeywordEditor()
+    {
+        if (this.keywordEditorHidden)
+            return;
+
+        this.updateMainTitle(this._keywordEditor.value);
+        this._listItemNode.classList.add(&quot;editor-hidden&quot;);
+    }
+
+    get keywordEditorHidden()
+    {
+        return this._listItemNode.classList.contains(&quot;editor-hidden&quot;);
+    }
+
+    // Protected
+
+    onattach()
+    {
+        super.onattach();
+
+        this._listItemNode.style.fontFamily = this._mainTitle;
+        this._listItemNode.classList.add(&quot;editor-hidden&quot;);
+        this._listItemNode.appendChild(this._keywordEditor);
+        this._listItemNode.addEventListener(&quot;click&quot;, this.showKeywordEditor.bind(this));
+    }
+
+    ondeselect()
+    {
+        this.hideKeywordEditor();
+    }
+
+    // Private
+
+    _keywordEditorKeyDown(event)
+    {
+        if (this.keywordEditorHidden)
+            return;
+
+        let keyCode = event.keyCode;
+        let enterKeyCode = WebInspector.KeyboardShortcut.Key.Enter.keyCode;
+        if (keyCode === enterKeyCode) {
+            this._listItemNode.classList.add(&quot;editor-hidden&quot;);
+            this.dispatchEventToListeners(WebInspector.VisualStyleFontFamilyTreeElement.Event.EditorKeyDown, {key: &quot;Enter&quot;});
+            return;
+        }
+
+        let escapeKeyCode = WebInspector.KeyboardShortcut.Key.Escape.keyCode;
+        if (keyCode === escapeKeyCode) {
+            this.dispatchEventToListeners(WebInspector.VisualStyleFontFamilyTreeElement.Event.EditorKeyDown, {key: &quot;Escape&quot;});
+            return;
+        }
+
+        let tabKeyCode = WebInspector.KeyboardShortcut.Key.Tab.keyCode;
+        if (keyCode === tabKeyCode) {
+            event.preventDefault();
+            this._dontFireKeyUp = true;
+            this.dispatchEventToListeners(WebInspector.VisualStyleFontFamilyTreeElement.Event.EditorKeyDown, {key: &quot;Tab&quot;});
+            return;
+        }
+
+        let key = event.keyIdentifier;
+        if (key === &quot;Up&quot; || key === &quot;Down&quot;) {
+            event.preventDefault();
+            this._dontFireKeyUp = true;
+            this.dispatchEventToListeners(WebInspector.VisualStyleFontFamilyTreeElement.Event.EditorKeyDown, {key});
+            return;
+        }
+
+        this.dispatchEventToListeners(WebInspector.VisualStyleFontFamilyTreeElement.Event.EditorKeyDown);
+    }
+
+    _keywordEditorKeyUp()
+    {
+        if (this.keywordEditorHidden || this._dontFireKeyUp)
+            return;
+
+        this.updateMainTitle(this._keywordEditor.value);
+    }
+
+    _keywordEditorBlurred()
+    {
+        this.hideKeywordEditor();
+        this.dispatchEventToListeners(WebInspector.VisualStyleFontFamilyTreeElement.Event.EditorBlurred);
+    }
+};
+
+WebInspector.VisualStyleFontFamilyTreeElement.Event = {
+    KeywordChanged: &quot;visual-style-font-family-tree-element-keyword-changed&quot;,
+    EditorKeyDown: &quot;visual-style-font-family-tree-element-editor-key-down&quot;,
+    EditorBlurred: &quot;visual-style-font-family-tree-element-editor-blurred&quot;
+};
</ins></span></pre>
</div>
</div>

</body>
</html>