<!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>[167779] 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/167779">167779</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-04-24 15:29:16 -0700 (Thu, 24 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: CSS autofill suggests properties instead of values when values are needed
https://bugs.webkit.org/show_bug.cgi?id=132090

Patch by Jonathan Wells &lt;jonowells@apple.com&gt; on 2014-04-24
Reviewed by Joseph Pecoraro.

Updates are required to the CodeMirror helpers to be compatible with
CodeMirror 4. Some of those changes have been made to fix an issue
with CSS autofill, CSS code coloring, and also
https://bugs.webkit.org/show_bug.cgi?id=131859. The main issue is that
CodeMirror 4's CSS mode (css.js) stores its parsing modes in a different
data structure. All references to state.stack are obscelete. Many
are fixed here and more will be in an upcoming patch.

* Tools/PrettyPrinting/CodeMirrorFormatters.js: Removed exception for checking state.stack properties.
* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WebInspector.CodeMirrorCompletionController.prototype._generateCSSCompletions): Corrected &quot;block&quot; state detection.
* UserInterface/External/CodeMirror/less.js: Removed.
* UserInterface/Views/CodeMirrorAdditions.js: Sets default state of &quot;block&quot; correctly.
* UserInterface/Views/CodeMirrorFormatters.js: Removed exception for checking state.stack properties.
* UserInterface/Views/SyntaxHighlightingDefaultTheme.css: Fix styles to match CSS mode changes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIToolsPrettyPrintingCodeMirrorFormattersjs">trunk/Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorCompletionControllerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorAdditionsjs">trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorFormattersjs">trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSyntaxHighlightingDefaultThemecss">trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceExternalCodeMirrorlessjs">trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/less.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (167778 => 167779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-04-24 22:24:41 UTC (rev 167778)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-04-24 22:29:16 UTC (rev 167779)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-04-24  Jonathan Wells  &lt;jonowells@apple.com&gt;
+
+        Web Inspector: CSS autofill suggests properties instead of values when values are needed
+        https://bugs.webkit.org/show_bug.cgi?id=132090
+
+        Reviewed by Joseph Pecoraro.
+
+        Updates are required to the CodeMirror helpers to be compatible with
+        CodeMirror 4. Some of those changes have been made to fix an issue
+        with CSS autofill, CSS code coloring, and also
+        https://bugs.webkit.org/show_bug.cgi?id=131859. The main issue is that
+        CodeMirror 4's CSS mode (css.js) stores its parsing modes in a different
+        data structure. All references to state.stack are obscelete. Many
+        are fixed here and more will be in an upcoming patch.
+
+        * Tools/PrettyPrinting/CodeMirrorFormatters.js: Removed exception for checking state.stack properties.
+        * UserInterface/Controllers/CodeMirrorCompletionController.js:
+        (WebInspector.CodeMirrorCompletionController.prototype._generateCSSCompletions): Corrected &quot;block&quot; state detection.
+        * UserInterface/External/CodeMirror/less.js: Removed.
+        * UserInterface/Views/CodeMirrorAdditions.js: Sets default state of &quot;block&quot; correctly.
+        * UserInterface/Views/CodeMirrorFormatters.js: Removed exception for checking state.stack properties.
+        * UserInterface/Views/SyntaxHighlightingDefaultTheme.css: Fix styles to match CSS mode changes.
+
</ins><span class="cx"> 2014-04-24  Antoine Quint  &lt;graouts@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: gradient editor does not appear for linear-gradient with no specified angle
</span><span class="lines">@@ -306,7 +329,7 @@
</span><span class="cx">         * Localizations/en.lproj/localizedStrings.js:
</span><span class="cx">         * UserInterface/Models/DOMNode.js:
</span><span class="cx">         * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
</span><del>-        * UserInterface/Views/Main.css: 
</del><ins>+        * UserInterface/Views/Main.css:
</ins><span class="cx"> 
</span><span class="cx"> 2014-03-28  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -858,7 +881,7 @@
</span><span class="cx"> 
</span><span class="cx">         * UserInterface/Views/DataGrid.js:
</span><span class="cx">         (WebInspector.DataGrid.prototype.removeChild):
</span><del>-        Add missing semicolon.        
</del><ins>+        Add missing semicolon.
</ins><span class="cx"> 
</span><span class="cx"> 2014-03-12  Brian Burg  &lt;bburg@apple.com&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -2049,7 +2072,7 @@
</span><span class="cx">         of linear gradients, we parse all values, save for lengths, and in the case of radial gradients, we preserve the
</span><span class="cx">         sizing information as a string and parse only the gradient stops as the sizing information is only useful to show
</span><span class="cx">         in an editor if attached to an element with metrics.
</span><del>-        
</del><ins>+
</ins><span class="cx">         Since instances of Gradient are used as the .value property of CodeMirrorGradientEditingController, we implement
</span><span class="cx">         the required .copy() and .toString() methods. The .toString() implementations are aware of default values for angles
</span><span class="cx">         and color stop offsets and only print those as necessary and use shorthands when possible.
</span><span class="lines">@@ -2195,7 +2218,7 @@
</span><span class="cx">         * UserInterface/CodeMirrorEditingController.js: Copied from Source/WebInspectorUI/UserInterface/CodeMirrorColorEditingController.js.
</span><span class="cx">         New class meant to be subclassed by any future editing controller, and already subclassed by
</span><span class="cx">         CodeMirrorColorEditingController. This class exposes several hooks for subclasses to customize its behavior:
</span><del>-        
</del><ins>+
</ins><span class="cx">         .initialValue: a value we can revert to if the editing is canceled
</span><span class="cx">         .cssClassName: a CSS class name that can be added to the editing controller's container
</span><span class="cx">         .popoverPreferredEdges: a list of preferredEdges as passed to Popover.prototype.present() with a sensible default
</span><span class="lines">@@ -2204,11 +2227,11 @@
</span><span class="cx">         .popoverDidPresent: called as the popover just was presented, typically overridden when content needs to tuned only after
</span><span class="cx">         being added to the DOM and setting of the necessary machinery to update the serialized value in the editor based on interaction
</span><span class="cx">         within the popover without changing the serialized value upon showing the popover the very first time.
</span><del>-        
</del><ins>+
</ins><span class="cx">         Additionally, the .value property must be an object supporting .toString() and .copy() method.
</span><span class="cx"> 
</span><span class="cx">         Finally, the .editingControllerDidStartEditing() and .editingControllerDidFinishEditing() delegate methods are fired
</span><del>-        as editing begins and finishes. 
</del><ins>+        as editing begins and finishes.
</ins><span class="cx"> 
</span><span class="cx">         (WebInspector.CodeMirrorEditingController):
</span><span class="cx">         (WebInspector.CodeMirrorEditingController.prototype.get marker):
</span><span class="lines">@@ -2253,7 +2276,7 @@
</span><span class="cx">         * UserInterface/HoverMenu.js:
</span><span class="cx">         We remove the assumption that a HoverMenu is only used to draw a single rounded rect based on a simple
</span><span class="cx">         Rect and instead support presentation based on an array of Rects where we either:
</span><del>-        
</del><ins>+
</ins><span class="cx">         - draw a single rounded rectangle if there is only a single Rect provided
</span><span class="cx">         - draw two disconnected open-ended rects if we're provided with two non-overlapping Rects
</span><span class="cx">         - draw a polygon surrounding all provided Rects in all other cases
</span><span class="lines">@@ -2550,7 +2573,7 @@
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Timothy Hatcher.
</span><span class="cx"> 
</span><del>-        Add a RuntimeManager event that the scope chain details sidebar can 
</del><ins>+        Add a RuntimeManager event that the scope chain details sidebar can
</ins><span class="cx">         listen to to trigger refresh.
</span><span class="cx"> 
</span><span class="cx">         Testing on this is blocked by http://webkit.org/b/128724
</span><span class="lines">@@ -4189,7 +4212,7 @@
</span><span class="cx"> 
</span><span class="cx">         * UserInterface/DebuggerSidebarPanel.js:
</span><span class="cx">         (WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
</span><del>-        Drive-by fix to pass along relaxedMatchDelay to the superclass. 
</del><ins>+        Drive-by fix to pass along relaxedMatchDelay to the superclass.
</ins><span class="cx"> 
</span><span class="cx">         * UserInterface/Main.js:
</span><span class="cx">         (WebInspector.loaded):
</span><span class="lines">@@ -5387,7 +5410,7 @@
</span><span class="cx">         Stop using __markedColor to identify a color marker and instead use the type on the matching
</span><span class="cx">         WebInspector.TextMarker. Additionally, create a WebInspector.TextMarker with type
</span><span class="cx">         WebInspector.TextMarker.Type.Color in createColorMarkers().
</span><del>-        
</del><ins>+
</ins><span class="cx">         * UserInterface/CodeMirrorColorEditingController.js:
</span><span class="cx">         (WebInspector.CodeMirrorColorEditingController):
</span><span class="cx">         Use a WebInspector.TextRange to track the edited range and obtain it directly from the
</span><span class="lines">@@ -5746,7 +5769,7 @@
</span><span class="cx">         to retrieve an object with the following structure:
</span><span class="cx">         {
</span><span class="cx">              &quot;regionFlow&quot;: &lt;Reference to the ContentFlow object referenced by the -webkit-flow-from property of the node&gt;,
</span><del>-             &quot;contentFlow&quot;: &lt;Reference to the ContentFlow object referenced by the -webkit-flow-into property of 
</del><ins>+             &quot;contentFlow&quot;: &lt;Reference to the ContentFlow object referenced by the -webkit-flow-into property of
</ins><span class="cx">                              the node or a parent of the node&gt;,
</span><span class="cx">              &quot;regions&quot;: [ list of DOMNodes representing the regions containers of the node. The node is split across all these regions. ]
</span><span class="cx">         }
</span><span class="lines">@@ -6172,7 +6195,7 @@
</span><span class="cx"> 
</span><span class="cx">         Automatically dispatch a contextmenu event in case WebInspector.ContextMenu.prototype.show()
</span><span class="cx">         is called outside of a contextmenu event handler and would therefore not show the expected
</span><del>-        context menu (except in the Remote Web Inspector where this already works). 
</del><ins>+        context menu (except in the Remote Web Inspector where this already works).
</ins><span class="cx"> 
</span><span class="cx">         * UserInterface/ContextMenu.js:
</span><span class="cx">         (WebInspector.ContextMenu.prototype.show):
</span><span class="lines">@@ -6425,7 +6448,7 @@
</span><span class="cx">         the arrow within the center of the attachment edge, we get in situations where we may
</span><span class="cx">         shrink the popover instead of shifting it to fit within the container frame. We now first
</span><span class="cx">         shift the preferred frame before getting its intersection with the container frame to
</span><del>-        avoid such situations. 
</del><ins>+        avoid such situations.
</ins><span class="cx"> 
</span><span class="cx">         * UserInterface/Popover.js:
</span><span class="cx">         (WebInspector.Popover.prototype._bestMetricsForEdge):
</span><span class="lines">@@ -6594,7 +6617,7 @@
</span><span class="cx"> 
</span><span class="cx"> 2013-11-06  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><del>-        Fix the display of query parameters when the value is missing. 
</del><ins>+        Fix the display of query parameters when the value is missing.
</ins><span class="cx"> 
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=123920
</span><span class="cx"> 
</span><span class="lines">@@ -6821,7 +6844,7 @@
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Timothy Hatcher.
</span><span class="cx"> 
</span><del>-        Moved some global functions out of Main.js, so that they can be used in the 
</del><ins>+        Moved some global functions out of Main.js, so that they can be used in the
</ins><span class="cx">         layout tests without including Main.js.
</span><span class="cx"> 
</span><span class="cx">         * UserInterface/Main.html: Referenced the new JS files.
</span><span class="lines">@@ -7223,7 +7246,7 @@
</span><span class="cx">         CSSStyleDeclarationTextEditor when the Cmd key is pressed and in the SourceCodeTextEditor
</span><span class="cx">         when either the Cmd key is pressed (NonSymbolTokens mode) or when the debugger is paused
</span><span class="cx">         (JavaScriptExpression mode).
</span><del>-        
</del><ins>+
</ins><span class="cx">         The tokenTrackingController is now smarter about how it tracks mouse events when it's enabled,
</span><span class="cx">         tracking &quot;mouseenter&quot; and &quot;mouseleave&quot; events to enable tracking allowing immediate detection of
</span><span class="cx">         tokens being hovered or no longer being hovered even with quick mouse movements. Additioanlly,
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIToolsPrettyPrintingCodeMirrorFormattersjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js (167778 => 167779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js        2014-04-24 22:24:41 UTC (rev 167778)
+++ trunk/Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js        2014-04-24 22:29:16 UTC (rev 167779)
</span><span class="lines">@@ -337,7 +337,7 @@
</span><span class="cx">             if (content === &quot;;&quot;)
</span><span class="cx">                 return 1;
</span><span class="cx">             if (content === &quot;,&quot;) { // &quot;a,b,c,...,z{}&quot; rule list at top level or in @media top level and only if the line length will be large.
</span><del>-                if ((!state.stack.length || state.stack.lastValue === &quot;@media{&quot;) &amp;&amp; state._cssPrettyPrint.lineLength &gt; 60) {
</del><ins>+                if ((!state.stack || !state.stack.length || state.stack.lastValue === &quot;@media{&quot;) &amp;&amp; state._cssPrettyPrint.lineLength &gt; 60) {
</ins><span class="cx">                     state._cssPrettyPrint.lineLength = 0;
</span><span class="cx">                     return 1;
</span><span class="cx">                 }
</span><span class="lines">@@ -395,7 +395,7 @@
</span><span class="cx">         // In order insert newlines in selector lists we need keep track of the length of the current line.
</span><span class="cx">         // This isn't exact line length, only the builder knows that, but it is good enough to get an idea.
</span><span class="cx">         // If we are at a top level, keep track of the current line length, otherwise we reset to 0.
</span><del>-        if (!state.stack.length || state.stack.lastValue === &quot;@media{&quot;)
</del><ins>+        if (!state.stack || !state.stack.length || state.stack.lastValue === &quot;@media{&quot;)
</ins><span class="cx">             state._cssPrettyPrint.lineLength += content.length;
</span><span class="cx">         else
</span><span class="cx">             state._cssPrettyPrint.lineLength = 0;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersCodeMirrorCompletionControllerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js (167778 => 167779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js        2014-04-24 22:24:41 UTC (rev 167778)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js        2014-04-24 22:29:16 UTC (rev 167779)
</span><span class="lines">@@ -518,15 +518,15 @@
</span><span class="cx"> 
</span><span class="cx">     _generateCSSCompletions: function(mainToken, base, suffix)
</span><span class="cx">     {
</span><del>-        // We only support completion inside CSS rules.
-        if (!mainToken.state || !mainToken.state.stack || !mainToken.state.stack.contains(&quot;rule&quot;))
</del><ins>+        // We only support completion inside CSS block context.
+        if (!mainToken.state || !mainToken.state.state || !mainToken.state.state === &quot;block&quot;)
</ins><span class="cx">             return [];
</span><span class="cx"> 
</span><span class="cx">         var token = mainToken;
</span><span class="cx">         var lineNumber = this._lineNumber;
</span><span class="cx"> 
</span><span class="cx">         // Scan backwards looking for the current property.
</span><del>-        while (token.state.stack.lastValue === &quot;propertyValue&quot;) {
</del><ins>+        while (token.state.state === &quot;prop&quot;) {
</ins><span class="cx">             // Found the beginning of the line. Go to the previous line.
</span><span class="cx">             if (!token.start) {
</span><span class="cx">                 --lineNumber;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceExternalCodeMirrorlessjs"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/less.js (167778 => 167779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/less.js        2014-04-24 22:24:41 UTC (rev 167778)
+++ trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/less.js        2014-04-24 22:29:16 UTC (rev 167779)
</span><span class="lines">@@ -1,346 +0,0 @@
</span><del>-/*
-  LESS mode - http://www.lesscss.org/
-  Ported to CodeMirror by Peter Kroon &lt;plakroon@gmail.com&gt;
-  Report bugs/issues here: https://github.com/marijnh/CodeMirror/issues
-  GitHub: @peterkroon
-*/
-
-CodeMirror.defineMode(&quot;less&quot;, function(config) {
-  var indentUnit = config.indentUnit, type;
-  function ret(style, tp) {type = tp; return style;}
-
-  var selectors = /(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/;
-
-  function tokenBase(stream, state) {
-    var ch = stream.next();
-
-    if (ch == &quot;@&quot;) {stream.eatWhile(/[\w\-]/); return ret(&quot;meta&quot;, stream.current());}
-    else if (ch == &quot;/&quot; &amp;&amp; stream.eat(&quot;*&quot;)) {
-      state.tokenize = tokenCComment;
-      return tokenCComment(stream, state);
-    } else if (ch == &quot;&lt;&quot; &amp;&amp; stream.eat(&quot;!&quot;)) {
-      state.tokenize = tokenSGMLComment;
-      return tokenSGMLComment(stream, state);
-    } else if (ch == &quot;=&quot;) ret(null, &quot;compare&quot;);
-    else if (ch == &quot;|&quot; &amp;&amp; stream.eat(&quot;=&quot;)) return ret(null, &quot;compare&quot;);
-    else if (ch == &quot;\&quot;&quot; || ch == &quot;'&quot;) {
-      state.tokenize = tokenString(ch);
-      return state.tokenize(stream, state);
-    } else if (ch == &quot;/&quot;) { // e.g.: .png will not be parsed as a class
-      if(stream.eat(&quot;/&quot;)){
-        state.tokenize = tokenSComment;
-        return tokenSComment(stream, state);
-      } else {
-        if(type == &quot;string&quot; || type == &quot;(&quot;) return ret(&quot;string&quot;, &quot;string&quot;);
-        if(state.stack[state.stack.length-1] !== undefined) return ret(null, ch);
-        stream.eatWhile(/[\a-zA-Z0-9\-_.\s]/);
-        if( /\/|\)|#/.test(stream.peek() || (stream.eatSpace() &amp;&amp; stream.peek() === &quot;)&quot;))  || stream.eol() )return ret(&quot;string&quot;, &quot;string&quot;); // let url(/images/logo.png) without quotes return as string
-      }
-    } else if (ch == &quot;!&quot;) {
-      stream.match(/^\s*\w*/);
-      return ret(&quot;keyword&quot;, &quot;important&quot;);
-    } else if (/\d/.test(ch)) {
-      stream.eatWhile(/[\w.%]/);
-      return ret(&quot;number&quot;, &quot;unit&quot;);
-    } else if (/[,+&lt;&gt;*\/]/.test(ch)) {
-      if(stream.peek() == &quot;=&quot; || type == &quot;a&quot;)return ret(&quot;string&quot;, &quot;string&quot;);
-      if(ch === &quot;,&quot;)return ret(null, ch);
-      return ret(null, &quot;select-op&quot;);
-    } else if (/[;{}:\[\]()~\|]/.test(ch)) {
-      if(ch == &quot;:&quot;){
-        stream.eatWhile(/[a-z\\\-]/);
-        if( selectors.test(stream.current()) ){
-          return ret(&quot;tag&quot;, &quot;tag&quot;);
-        } else if(stream.peek() == &quot;:&quot;){//::-webkit-search-decoration
-          stream.next();
-          stream.eatWhile(/[a-z\\\-]/);
-          if(stream.current().match(/\:\:\-(o|ms|moz|webkit)\-/))return ret(&quot;string&quot;, &quot;string&quot;);
-          if( selectors.test(stream.current().substring(1)) )return ret(&quot;tag&quot;, &quot;tag&quot;);
-          return ret(null, ch);
-        } else {
-          return ret(null, ch);
-        }
-      } else if(ch == &quot;~&quot;){
-        if(type == &quot;r&quot;)return ret(&quot;string&quot;, &quot;string&quot;);
-      } else {
-        return ret(null, ch);
-      }
-    } else if (ch == &quot;.&quot;) {
-      if(type == &quot;(&quot;)return ret(&quot;string&quot;, &quot;string&quot;); // allow url(../image.png)
-      stream.eatWhile(/[\a-zA-Z0-9\-_]/);
-      if(stream.peek() === &quot; &quot;)stream.eatSpace();
-      if(stream.peek() === &quot;)&quot; || type === &quot;:&quot;)return ret(&quot;number&quot;, &quot;unit&quot;);//rgba(0,0,0,.25);
-      else if(stream.current().length &gt;1){
-        if(state.stack[state.stack.length-1] === &quot;rule&quot; &amp;&amp; stream.peek().match(/{|,|\+|\(/) === null)return ret(&quot;number&quot;, &quot;unit&quot;);
-      }
-      return ret(&quot;tag&quot;, &quot;tag&quot;);
-    } else if (ch == &quot;#&quot;) {
-      //we don't eat white-space, we want the hex color and or id only
-      stream.eatWhile(/[A-Za-z0-9]/);
-      //check if there is a proper hex color length e.g. #eee || #eeeEEE
-      if(stream.current().length == 4 || stream.current().length == 7){
-        if(stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false) != null){//is there a valid hex color value present in the current stream
-          //when not a valid hex value, parse as id
-          if(stream.current().substring(1) != stream.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,false))return ret(&quot;atom&quot;, &quot;tag&quot;);
-          //eat white-space
-          stream.eatSpace();
-          //when hex value declaration doesn't end with [;,] but is does with a slash/cc comment treat it as an id, just like the other hex values that don't end with[;,]
-          if( /[\/&lt;&gt;.(){!$%^&amp;*_\-\\?=+\|#'~`]/.test(stream.peek()) ){
-            if(type === &quot;select-op&quot;)return ret(&quot;number&quot;, &quot;unit&quot;); else return ret(&quot;atom&quot;, &quot;tag&quot;);
-          }
-          //#time { color: #aaa }
-          else if(stream.peek() == &quot;}&quot; )return ret(&quot;number&quot;, &quot;unit&quot;);
-          //we have a valid hex color value, parse as id whenever an element/class is defined after the hex(id) value e.g. #eee aaa || #eee .aaa
-          else if( /[a-zA-Z\\]/.test(stream.peek()) )return ret(&quot;atom&quot;, &quot;tag&quot;);
-          //when a hex value is on the end of a line, parse as id
-          else if(stream.eol())return ret(&quot;atom&quot;, &quot;tag&quot;);
-          //default
-          else return ret(&quot;number&quot;, &quot;unit&quot;);
-        } else {//when not a valid hexvalue in the current stream e.g. #footer
-          stream.eatWhile(/[\w\\\-]/);
-          return ret(&quot;atom&quot;, stream.current());
-        }
-      } else {//when not a valid hexvalue length
-        stream.eatWhile(/[\w\\\-]/);
-        if(state.stack[state.stack.length-1] === &quot;rule&quot;)return ret(&quot;atom&quot;, stream.current());return ret(&quot;atom&quot;, stream.current());
-        return ret(&quot;atom&quot;, &quot;tag&quot;);
-      }
-    } else if (ch == &quot;&amp;&quot;) {
-      stream.eatWhile(/[\w\-]/);
-      return ret(null, ch);
-    } else {
-      stream.eatWhile(/[\w\\\-_%.{]/);
-      if(stream.current().match(/\\/) !== null){
-        if(stream.current().charAt(stream.current().length-1) === &quot;\\&quot;){
-          stream.eat(/\'|\&quot;|\)|\(/);
-          while(stream.eatWhile(/[\w\\\-_%.{]/)){
-            stream.eat(/\'|\&quot;|\)|\(/);
-          }
-          return ret(&quot;string&quot;, stream.current());
-        }
-      } //else if(type === &quot;tag&quot;)return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if(type == &quot;string&quot;){
-        if(state.stack[state.stack.length-1] === &quot;{&quot; &amp;&amp; stream.peek() === &quot;:&quot;)return ret(&quot;variable&quot;, &quot;variable&quot;);
-        if(stream.peek() === &quot;/&quot;)stream.eatWhile(/[\w\\\-_%.{:\/]/);
-        return ret(type, stream.current());
-      } else if(stream.current().match(/(^http$|^https$)/) != null){
-        stream.eatWhile(/[\w\\\-_%.{:\/]/);
-        if(stream.peek() === &quot;/&quot;)stream.eatWhile(/[\w\\\-_%.{:\/]/);
-        return ret(&quot;string&quot;, &quot;string&quot;);
-      } else if(stream.peek() == &quot;&lt;&quot; || stream.peek() == &quot;&gt;&quot; || stream.peek() == &quot;+&quot;){
-        if(type === &quot;(&quot; &amp;&amp; (stream.current() === &quot;n&quot; || stream.current() === &quot;-n&quot;))return ret(&quot;string&quot;, stream.current());
-        return ret(&quot;tag&quot;, &quot;tag&quot;);
-      } else if( /\(/.test(stream.peek()) ){
-        if(stream.current() === &quot;when&quot;)return ret(&quot;variable&quot;,&quot;variable&quot;);
-        else if(state.stack[state.stack.length-1] === &quot;@media&quot; &amp;&amp; stream.current() === &quot;and&quot;)return ret(&quot;variable&quot;,stream.current());
-        return ret(null, ch);
-      } else if (stream.peek() == &quot;/&quot; &amp;&amp; state.stack[state.stack.length-1] !== undefined){ // url(dir/center/image.png)
-        if(stream.peek() === &quot;/&quot;)stream.eatWhile(/[\w\\\-_%.{:\/]/);
-        return ret(&quot;string&quot;, stream.current());
-      } else if( stream.current().match(/\-\d|\-.\d/) ){ // match e.g.: -5px -0.4 etc... only colorize the minus sign
-        //commment out these 2 comment if you want the minus sign to be parsed as null -500px
-        //stream.backUp(stream.current().length-1);
-        //return ret(null, ch);
-        return ret(&quot;number&quot;, &quot;unit&quot;);
-      } else if( /\/|[\s\)]/.test(stream.peek() || stream.eol() || (stream.eatSpace() &amp;&amp; stream.peek() == &quot;/&quot;)) &amp;&amp; stream.current().indexOf(&quot;.&quot;) !== -1){
-        if(stream.current().substring(stream.current().length-1,stream.current().length) == &quot;{&quot;){
-          stream.backUp(1);
-          return ret(&quot;tag&quot;, &quot;tag&quot;);
-        }//end if
-        stream.eatSpace();
-        if( /[{&lt;&gt;.a-zA-Z\/]/.test(stream.peek())  || stream.eol() )return ret(&quot;tag&quot;, &quot;tag&quot;); // e.g. button.icon-plus
-        return ret(&quot;string&quot;, &quot;string&quot;); // let url(/images/logo.png) without quotes return as string
-      } else if( stream.eol() || stream.peek() == &quot;[&quot; || stream.peek() == &quot;#&quot; || type == &quot;tag&quot; ){
-
-        if(stream.current().substring(stream.current().length-1,stream.current().length) == &quot;{&quot;)stream.backUp(1);
-        else if(state.stack[state.stack.length-1] === &quot;border-color&quot; || state.stack[state.stack.length-1] === &quot;background-position&quot; || state.stack[state.stack.length-1] === &quot;font-family&quot;)return ret(null, stream.current());
-        else if(type === &quot;tag&quot;)return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if((type === &quot;:&quot; || type === &quot;unit&quot;) &amp;&amp; state.stack[state.stack.length-1] === &quot;rule&quot;)return ret(null, stream.current());
-        else if(state.stack[state.stack.length-1] === &quot;rule&quot; &amp;&amp; type === &quot;tag&quot;)return ret(&quot;string&quot;, stream.current());
-        else if(state.stack[state.stack.length-1] === &quot;;&quot; &amp;&amp; type === &quot;:&quot;)return ret(null, stream.current());
-        //else if(state.stack[state.stack.length-1] === &quot;;&quot; || type === &quot;&quot;)return ret(&quot;variable&quot;, stream.current());
-        else if(stream.peek() === &quot;#&quot; &amp;&amp; type !== undefined &amp;&amp; type.match(/\+|,|tag|select\-op|}|{|;/g) === null)return ret(&quot;string&quot;, stream.current());
-        else if(type === &quot;variable&quot;)return ret(null, stream.current());
-        else if(state.stack[state.stack.length-1] === &quot;{&quot; &amp;&amp; type === &quot;comment&quot;)return ret(&quot;variable&quot;, stream.current());
-        else if(state.stack.length === 0 &amp;&amp; (type === &quot;;&quot; || type === &quot;comment&quot;))return ret(&quot;tag&quot;, stream.current());
-        else if((state.stack[state.stack.length-1] === &quot;{&quot; || type === &quot;;&quot;) &amp;&amp; state.stack[state.stack.length-1] !== &quot;@media{&quot;)return ret(&quot;variable&quot;, stream.current());
-        else if(state.stack[state.stack.length-2] === &quot;{&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;;&quot;)return ret(&quot;variable&quot;, stream.current());
-
-        return ret(&quot;tag&quot;, &quot;tag&quot;);
-      } else if(type == &quot;compare&quot; || type == &quot;a&quot; || type == &quot;(&quot;){
-        return ret(&quot;string&quot;, &quot;string&quot;);
-      } else if(type == &quot;|&quot; || stream.current() == &quot;-&quot; || type == &quot;[&quot;){
-        if(type == &quot;|&quot; &amp;&amp; stream.peek().match(/\]|=|\~/) !== null)return ret(&quot;number&quot;, stream.current());
-        else if(type == &quot;|&quot; )return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if(type == &quot;[&quot;){
-          stream.eatWhile(/\w\-/);
-          return ret(&quot;number&quot;, stream.current());
-        }
-        return ret(null, ch);
-      } else if((stream.peek() == &quot;:&quot;) || ( stream.eatSpace() &amp;&amp; stream.peek() == &quot;:&quot;)) {
-        stream.next();
-        var t_v = stream.peek() == &quot;:&quot; ? true : false;
-        if(!t_v){
-          var old_pos = stream.pos;
-          var sc = stream.current().length;
-          stream.eatWhile(/[a-z\\\-]/);
-          var new_pos = stream.pos;
-          if(stream.current().substring(sc-1).match(selectors) != null){
-            stream.backUp(new_pos-(old_pos-1));
-            return ret(&quot;tag&quot;, &quot;tag&quot;);
-          } else stream.backUp(new_pos-(old_pos-1));
-        } else {
-          stream.backUp(1);
-        }
-        if(t_v)return ret(&quot;tag&quot;, &quot;tag&quot;); else return ret(&quot;variable&quot;, &quot;variable&quot;);
-      } else if(state.stack[state.stack.length-1]  === &quot;font-family&quot; || state.stack[state.stack.length-1]  === &quot;background-position&quot; || state.stack[state.stack.length-1]  === &quot;border-color&quot;){
-        return ret(null, null);
-      } else {
-
-        if(state.stack[state.stack.length-1] === null &amp;&amp; type === &quot;:&quot;)return ret(null, stream.current());
-
-        //else if((type === &quot;)&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;rule&quot;) || (state.stack[state.stack.length-2] === &quot;{&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;rule&quot; &amp;&amp; type === &quot;variable&quot;))return ret(null, stream.current());
-
-        else if(/\^|\$/.test(stream.current()) &amp;&amp; stream.peek().match(/\~|=/) !== null)return ret(&quot;string&quot;, &quot;string&quot;);//att^=val
-
-        else if(type === &quot;unit&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;rule&quot;)return ret(null, &quot;unit&quot;);
-        else if(type === &quot;unit&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;;&quot;)return ret(null, &quot;unit&quot;);
-        else if(type === &quot;)&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;rule&quot;)return ret(null, &quot;unit&quot;);
-        else if(type &amp;&amp; type.match(&quot;@&quot;) !== null  &amp;&amp; state.stack[state.stack.length-1] === &quot;rule&quot;)return ret(null, &quot;unit&quot;);
-        //else if(type === &quot;unit&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;rule&quot;)return ret(null, stream.current());
-
-        else if((type === &quot;;&quot; || type === &quot;}&quot; || type === &quot;,&quot;) &amp;&amp; state.stack[state.stack.length-1] === &quot;;&quot;)return ret(&quot;tag&quot;, stream.current());
-        else if((type === &quot;;&quot; &amp;&amp; stream.peek() !== undefined &amp;&amp; stream.peek().match(/{|./) === null) || (type === &quot;;&quot; &amp;&amp; stream.eatSpace() &amp;&amp; stream.peek().match(/{|./) === null))return ret(&quot;variable&quot;, stream.current());
-        else if((type === &quot;@media&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;@media&quot;) || type === &quot;@namespace&quot;)return ret(&quot;tag&quot;, stream.current());
-
-        else if(type === &quot;{&quot;  &amp;&amp; state.stack[state.stack.length-1] === &quot;;&quot; &amp;&amp; stream.peek() === &quot;{&quot;)return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if((type === &quot;{&quot; || type === &quot;:&quot;) &amp;&amp; state.stack[state.stack.length-1] === &quot;;&quot;)return ret(null, stream.current());
-        else if((state.stack[state.stack.length-1] === &quot;{&quot; &amp;&amp; stream.eatSpace() &amp;&amp; stream.peek().match(/.|#/) === null) || type === &quot;select-op&quot;  || (state.stack[state.stack.length-1] === &quot;rule&quot; &amp;&amp; type === &quot;,&quot;) )return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if(type === &quot;variable&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;rule&quot;)return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if((stream.eatSpace() &amp;&amp; stream.peek() === &quot;{&quot;) || stream.eol() || stream.peek() === &quot;{&quot;)return ret(&quot;tag&quot;, &quot;tag&quot;);
-        //this one messes up indentation
-        //else if((type === &quot;}&quot; &amp;&amp; stream.peek() !== &quot;:&quot;) || (type === &quot;}&quot; &amp;&amp; stream.eatSpace() &amp;&amp; stream.peek() !== &quot;:&quot;))return(type, &quot;tag&quot;);
-
-        else if(type === &quot;)&quot; &amp;&amp; (stream.current() == &quot;and&quot; || stream.current() == &quot;and &quot;))return ret(&quot;variable&quot;, &quot;variable&quot;);
-        else if(type === &quot;)&quot; &amp;&amp; (stream.current() == &quot;when&quot; || stream.current() == &quot;when &quot;))return ret(&quot;variable&quot;, &quot;variable&quot;);
-        else if(type === &quot;)&quot; || type === &quot;comment&quot; || type === &quot;{&quot;)return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if(stream.sol())return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if((stream.eatSpace() &amp;&amp; stream.peek() === &quot;#&quot;) || stream.peek() === &quot;#&quot;)return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if(state.stack.length === 0)return ret(&quot;tag&quot;, &quot;tag&quot;);
-        else if(type === &quot;;&quot; &amp;&amp; stream.peek() !== undefined &amp;&amp; stream.peek().match(/^[.|\#]/g) !== null)return ret(&quot;tag&quot;, &quot;tag&quot;);
-
-        else if(type === &quot;:&quot;){stream.eatSpace();return ret(null, stream.current());}
-
-        else if(stream.current() === &quot;and &quot; || stream.current() === &quot;and&quot;)return ret(&quot;variable&quot;, stream.current());
-        else if(type === &quot;;&quot; &amp;&amp; state.stack[state.stack.length-1] === &quot;{&quot;)return ret(&quot;variable&quot;, stream.current());
-
-        else if(state.stack[state.stack.length-1] === &quot;rule&quot;)return ret(null, stream.current());
-
-        return ret(&quot;tag&quot;, stream.current());
-      }
-    }
-  }
-
-  function tokenSComment(stream, state) { // SComment = Slash comment
-    stream.skipToEnd();
-    state.tokenize = tokenBase;
-    return ret(&quot;comment&quot;, &quot;comment&quot;);
-  }
-
-  function tokenCComment(stream, state) {
-    var maybeEnd = false, ch;
-    while ((ch = stream.next()) != null) {
-      if (maybeEnd &amp;&amp; ch == &quot;/&quot;) {
-        state.tokenize = tokenBase;
-        break;
-      }
-      maybeEnd = (ch == &quot;*&quot;);
-    }
-    return ret(&quot;comment&quot;, &quot;comment&quot;);
-  }
-
-  function tokenSGMLComment(stream, state) {
-    var dashes = 0, ch;
-    while ((ch = stream.next()) != null) {
-      if (dashes &gt;= 2 &amp;&amp; ch == &quot;&gt;&quot;) {
-        state.tokenize = tokenBase;
-        break;
-      }
-      dashes = (ch == &quot;-&quot;) ? dashes + 1 : 0;
-    }
-    return ret(&quot;comment&quot;, &quot;comment&quot;);
-  }
-
-  function tokenString(quote) {
-    return function(stream, state) {
-      var escaped = false, ch;
-      while ((ch = stream.next()) != null) {
-        if (ch == quote &amp;&amp; !escaped)
-          break;
-        escaped = !escaped &amp;&amp; ch == &quot;\\&quot;;
-      }
-      if (!escaped) state.tokenize = tokenBase;
-      return ret(&quot;string&quot;, &quot;string&quot;);
-    };
-  }
-
-  return {
-    startState: function(base) {
-      return {tokenize: tokenBase,
-              baseIndent: base || 0,
-              stack: []};
-    },
-
-    token: function(stream, state) {
-      if (stream.eatSpace()) return null;
-      var style = state.tokenize(stream, state);
-
-      var context = state.stack[state.stack.length-1];
-      if (type == &quot;hash&quot; &amp;&amp; context == &quot;rule&quot;) style = &quot;atom&quot;;
-      else if (style == &quot;variable&quot;) {
-        if (context == &quot;rule&quot;) style = null; //&quot;tag&quot;
-        else if (!context || context == &quot;@media{&quot;) {
-          style = stream.current() == &quot;when&quot;  ? &quot;variable&quot; :
-          /[\s,|\s\)|\s]/.test(stream.peek()) ? &quot;tag&quot;      : type;
-        }
-      }
-
-      if (context == &quot;rule&quot; &amp;&amp; /^[\{\};]$/.test(type))
-        state.stack.pop();
-      if (type == &quot;{&quot;) {
-        if (context == &quot;@media&quot;) state.stack[state.stack.length-1] = &quot;@media{&quot;;
-        else state.stack.push(&quot;{&quot;);
-      }
-      else if (type == &quot;}&quot;) state.stack.pop();
-      else if (type == &quot;@media&quot;) state.stack.push(&quot;@media&quot;);
-      else if (stream.current() === &quot;font-family&quot;) state.stack[state.stack.length-1] = &quot;font-family&quot;;
-      else if (stream.current() === &quot;background-position&quot;) state.stack[state.stack.length-1] = &quot;background-position&quot;;
-      else if (stream.current() === &quot;border-color&quot;) state.stack[state.stack.length-1] = &quot;border-color&quot;;
-      else if (context == &quot;{&quot; &amp;&amp; type != &quot;comment&quot; &amp;&amp; type !== &quot;tag&quot;) state.stack.push(&quot;rule&quot;);
-      else if (stream.peek() === &quot;:&quot; &amp;&amp; stream.current().match(/@|#/) === null) style = type;
-      if(type === &quot;;&quot; &amp;&amp; (state.stack[state.stack.length-1] == &quot;font-family&quot; || state.stack[state.stack.length-1] == &quot;background-position&quot; || state.stack[state.stack.length-1] == &quot;border-color&quot;))state.stack[state.stack.length-1] = stream.current();
-      else if(type === &quot;tag&quot; &amp;&amp; stream.peek() === &quot;)&quot; &amp;&amp; stream.current().match(/\:/) === null){type = null; style = null;}
-      // ????
-      else if((type === &quot;variable&quot; &amp;&amp; stream.peek() === &quot;)&quot;) || (type === &quot;variable&quot; &amp;&amp; stream.eatSpace() &amp;&amp; stream.peek() === &quot;)&quot;))return ret(null,stream.current());
-      return style;
-    },
-
-    indent: function(state, textAfter) {
-      var n = state.stack.length;
-      if (/^\}/.test(textAfter))
-        n -= state.stack[state.stack.length-1] === &quot;rule&quot; ? 2 : 1;
-      else if (state.stack[state.stack.length-2] === &quot;{&quot;)
-        n -= state.stack[state.stack.length-1] === &quot;rule&quot; ? 1 : 0;
-      return state.baseIndent + n * indentUnit;
-    },
-
-    electricChars: &quot;}&quot;,
-    blockCommentStart: &quot;/*&quot;,
-    blockCommentEnd: &quot;*/&quot;,
-    lineComment: &quot;//&quot;
-  };
-});
-
-CodeMirror.defineMIME(&quot;text/x-less&quot;, &quot;less&quot;);
-if (!CodeMirror.mimeModes.hasOwnProperty(&quot;text/css&quot;))
-  CodeMirror.defineMIME(&quot;text/css&quot;, &quot;less&quot;);
</del></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorAdditionsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js (167778 => 167779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js        2014-04-24 22:24:41 UTC (rev 167778)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js        2014-04-24 22:29:16 UTC (rev 167779)
</span><span class="lines">@@ -233,9 +233,10 @@
</span><span class="cx">         // So call it to get the original start state that we will modify.
</span><span class="cx">         var state = this._startState(base);
</span><span class="cx"> 
</span><del>-        // Start the stack off like it has already parsed a rule. This causes everything
</del><ins>+        // Start off the state stack like it has already parsed a rule. This causes everything
</ins><span class="cx">         // after to be parsed as properties in a rule.
</span><del>-        state.stack = [&quot;rule&quot;];
</del><ins>+        state.state = &quot;block&quot;;
+        state.context.type = &quot;block&quot;;
</ins><span class="cx"> 
</span><span class="cx">         return state;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCodeMirrorFormattersjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js (167778 => 167779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js        2014-04-24 22:24:41 UTC (rev 167778)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js        2014-04-24 22:29:16 UTC (rev 167779)
</span><span class="lines">@@ -337,7 +337,7 @@
</span><span class="cx">             if (content === &quot;;&quot;)
</span><span class="cx">                 return 1;
</span><span class="cx">             if (content === &quot;,&quot;) { // &quot;a,b,c,...,z{}&quot; rule list at top level or in @media top level and only if the line length will be large.
</span><del>-                if ((!state.stack.length || state.stack.lastValue === &quot;@media{&quot;) &amp;&amp; state._cssPrettyPrint.lineLength &gt; 60) {
</del><ins>+                if ((!state.stack || !state.stack.length || state.stack.lastValue === &quot;@media{&quot;) &amp;&amp; state._cssPrettyPrint.lineLength &gt; 60) {
</ins><span class="cx">                     state._cssPrettyPrint.lineLength = 0;
</span><span class="cx">                     return 1;
</span><span class="cx">                 }
</span><span class="lines">@@ -395,7 +395,7 @@
</span><span class="cx">         // In order insert newlines in selector lists we need keep track of the length of the current line.
</span><span class="cx">         // This isn't exact line length, only the builder knows that, but it is good enough to get an idea.
</span><span class="cx">         // If we are at a top level, keep track of the current line length, otherwise we reset to 0.
</span><del>-        if (!state.stack.length || state.stack.lastValue === &quot;@media{&quot;)
</del><ins>+        if (!state.stack || !state.stack.length || state.stack.lastValue === &quot;@media{&quot;)
</ins><span class="cx">             state._cssPrettyPrint.lineLength += content.length;
</span><span class="cx">         else
</span><span class="cx">             state._cssPrettyPrint.lineLength = 0;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSyntaxHighlightingDefaultThemecss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css (167778 => 167779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css        2014-04-24 22:24:41 UTC (rev 167778)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SyntaxHighlightingDefaultTheme.css        2014-04-24 22:29:16 UTC (rev 167779)
</span><span class="lines">@@ -45,9 +45,10 @@
</span><span class="cx"> .cm-s-default .cm-tag.cm-bracket,
</span><span class="cx"> .cm-s-default .cm-atom,
</span><span class="cx"> .cm-s-default .cm-keyword,
</span><del>-.cm-s-default .cm-m-css.cm-tag,
</del><ins>+.cm-s-default .cm-m-css.cm-atom,
</ins><span class="cx"> .cm-s-default .cm-m-css.cm-meta,
</span><span class="cx"> .cm-s-default .cm-m-css.cm-variable-3,
</span><ins>+.cm-s-default .cm-m-css.cm-property,
</ins><span class="cx"> .cm-s-default .cm-m-javascript.cm-builtin,
</span><span class="cx"> .syntax-highlighted .css-keyword,
</span><span class="cx"> .syntax-highlighted .css-tag,
</span><span class="lines">@@ -59,7 +60,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .cm-s-default .cm-number,
</span><del>-.cm-s-default .cm-m-css.cm-atom,
</del><span class="cx"> .syntax-highlighted .css-number,
</span><span class="cx"> .syntax-highlighted .javascript-number {
</span><span class="cx">     color: rgb(28, 0, 207);
</span><span class="lines">@@ -68,12 +68,12 @@
</span><span class="cx"> .cm-s-default .cm-def,
</span><span class="cx"> .cm-s-default .cm-bracket,
</span><span class="cx"> .cm-s-default .cm-operator,
</span><del>-.cm-s-default .cm-qualifier,
</del><span class="cx"> .cm-s-default .cm-variable,
</span><span class="cx"> .cm-s-default .cm-variable-2,
</span><ins>+.cm-s-default .cm-m-css.cm-tag,
</ins><span class="cx"> .cm-s-default .cm-m-css.cm-string-2,
</span><span class="cx"> .cm-s-default .cm-m-css.cm-builtin,
</span><del>-.cm-s-default .cm-m-css.cm-property,
</del><ins>+.cm-s-default .cm-m-css.cm-qualifier,
</ins><span class="cx"> .syntax-highlighted .css-property,
</span><span class="cx"> .syntax-highlighted .css-selector,
</span><span class="cx"> .syntax-highlighted .javascript-ident {
</span></span></pre>
</div>
</div>

</body>
</html>