<!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>[181912] 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/181912">181912</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-24 15:54:07 -0700 (Tue, 24 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Adopt ES6 Class Syntax for CSSStyleDeclarationTextEditor
https://bugs.webkit.org/show_bug.cgi?id=143019
Patch by Tobias Reiss <tobi+webkit@basecode.de> on 2015-03-24
Reviewed by Timothy Hatcher.
- Convert CSSStyleDeclarationTextEditor to use class syntax
- Convert constructor functions to constructor methods
- Convert "constructor.method" to class static methods where possible
- Convert all methods to method syntax, eliminate commas between methods
- Convert all superclass calls in classes to use "super"
- Removed FIXME from WebInspector.Object subclasses, added calls to super.
- Fixed strict mode issues now that classes enforce strict mode (see below).
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
Many function declarations modified.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (181911 => 181912)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-03-24 22:47:55 UTC (rev 181911)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-03-24 22:54:07 UTC (rev 181912)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-03-24 Tobias Reiss <tobi+webkit@basecode.de>
+
+ Web Inspector: Adopt ES6 Class Syntax for CSSStyleDeclarationTextEditor
+ https://bugs.webkit.org/show_bug.cgi?id=143019
+
+ Reviewed by Timothy Hatcher.
+
+ - Convert CSSStyleDeclarationTextEditor to use class syntax
+ - Convert constructor functions to constructor methods
+ - Convert "constructor.method" to class static methods where possible
+ - Convert all methods to method syntax, eliminate commas between methods
+ - Convert all superclass calls in classes to use "super"
+ - Removed FIXME from WebInspector.Object subclasses, added calls to super.
+ - Fixed strict mode issues now that classes enforce strict mode (see below).
+
+ * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
+ Many function declarations modified.
+
</ins><span class="cx"> 2015-03-24 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Workaround issue causing uncaught exception in Inspector
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsCSSStyleDeclarationTextEditorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js (181911 => 181912)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js        2015-03-24 22:47:55 UTC (rev 181911)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js        2015-03-24 22:54:07 UTC (rev 181912)
</span><span class="lines">@@ -23,89 +23,76 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.CSSStyleDeclarationTextEditor = function(delegate, style, element)
</del><ins>+WebInspector.CSSStyleDeclarationTextEditor = class CSSStyleDeclarationTextEditor extends WebInspector.Object
</ins><span class="cx"> {
</span><del>- // FIXME: Convert this to a WebInspector.Object subclass, and call super().
- // WebInspector.Object.call(this);
</del><ins>+ constructor(delegate, style, element)
+ {
+ super();
</ins><span class="cx">
</span><del>- this._element = element || document.createElement("div");
- this._element.classList.add(WebInspector.CSSStyleDeclarationTextEditor.StyleClassName);
- this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
</del><ins>+ this._element = element || document.createElement("div");
+ this._element.classList.add(WebInspector.CSSStyleDeclarationTextEditor.StyleClassName);
+ this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName);
</ins><span class="cx">
</span><del>- this._showsImplicitProperties = true;
- this._alwaysShowPropertyNames = {};
- this._sortProperties = false;
</del><ins>+ this._showsImplicitProperties = true;
+ this._alwaysShowPropertyNames = {};
+ this._sortProperties = false;
</ins><span class="cx">
</span><del>- this._prefixWhitespace = "";
- this._suffixWhitespace = "";
- this._linePrefixWhitespace = "";
</del><ins>+ this._prefixWhitespace = "";
+ this._suffixWhitespace = "";
+ this._linePrefixWhitespace = "";
</ins><span class="cx">
</span><del>- this._delegate = delegate || null;
</del><ins>+ this._delegate = delegate || null;
</ins><span class="cx">
</span><del>- this._codeMirror = CodeMirror(this.element, {
- readOnly: true,
- lineWrapping: true,
- mode: "css-rule",
- electricChars: false,
- indentWithTabs: true,
- indentUnit: 4,
- smartIndent: false,
- matchBrackets: true,
- autoCloseBrackets: true
- });
</del><ins>+ this._codeMirror = CodeMirror(this.element, {
+ readOnly: true,
+ lineWrapping: true,
+ mode: "css-rule",
+ electricChars: false,
+ indentWithTabs: true,
+ indentUnit: 4,
+ smartIndent: false,
+ matchBrackets: true,
+ autoCloseBrackets: true
+ });
</ins><span class="cx">
</span><del>- this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this);
- this._tokenTrackingController = new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror, this);
</del><ins>+ this._completionController = new WebInspector.CodeMirrorCompletionController(this._codeMirror, this);
+ this._tokenTrackingController = new WebInspector.CodeMirrorTokenTrackingController(this._codeMirror, this);
</ins><span class="cx">
</span><del>- this._jumpToSymbolTrackingModeEnabled = false;
- this._tokenTrackingController.classNameForHighlightedRange = WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName;
- this._tokenTrackingController.mouseOverDelayDuration = 0;
- this._tokenTrackingController.mouseOutReleaseDelayDuration = 0;
- this._tokenTrackingController.mode = WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens;
</del><ins>+ this._jumpToSymbolTrackingModeEnabled = false;
+ this._tokenTrackingController.classNameForHighlightedRange = WebInspector.CodeMirrorTokenTrackingController.JumpToSymbolHighlightStyleClassName;
+ this._tokenTrackingController.mouseOverDelayDuration = 0;
+ this._tokenTrackingController.mouseOutReleaseDelayDuration = 0;
+ this._tokenTrackingController.mode = WebInspector.CodeMirrorTokenTrackingController.Mode.NonSymbolTokens;
</ins><span class="cx">
</span><del>- // Make sure CompletionController adds event listeners first.
- // Otherwise we end up in race conditions during complete or delete-complete phases.
- this._codeMirror.on("change", this._contentChanged.bind(this));
- this._codeMirror.on("blur", this._editorBlured.bind(this));
</del><ins>+ // Make sure CompletionController adds event listeners first.
+ // Otherwise we end up in race conditions during complete or delete-complete phases.
+ this._codeMirror.on("change", this._contentChanged.bind(this));
+ this._codeMirror.on("blur", this._editorBlured.bind(this));
</ins><span class="cx">
</span><del>- this.style = style;
-};
</del><ins>+ this.style = style;
+ }
</ins><span class="cx">
</span><del>-// FIXME: Move to a WebInspector.Object subclass and we can remove this.
-WebInspector.Object.deprecatedAddConstructorFunctions(WebInspector.CSSStyleDeclarationTextEditor);
-
-WebInspector.CSSStyleDeclarationTextEditor.StyleClassName = "css-style-text-editor";
-WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName = "read-only";
-WebInspector.CSSStyleDeclarationTextEditor.ColorSwatchElementStyleClassName = "color-swatch";
-WebInspector.CSSStyleDeclarationTextEditor.CheckboxPlaceholderElementStyleClassName = "checkbox-placeholder";
-WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName = "editing-line";
-WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay = 250;
-WebInspector.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay = 2000;
-
-WebInspector.CSSStyleDeclarationTextEditor.prototype = {
- constructor: WebInspector.CSSStyleDeclarationTextEditor,
-
</del><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get element()
</span><span class="cx"> {
</span><span class="cx"> return this._element;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get delegate()
</span><span class="cx"> {
</span><span class="cx"> return this._delegate;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set delegate(delegate)
</span><span class="cx"> {
</span><span class="cx"> this._delegate = delegate || null;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get style()
</span><span class="cx"> {
</span><span class="cx"> return this._style;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set style(style)
</span><span class="cx"> {
</span><span class="lines">@@ -129,29 +116,29 @@
</span><span class="cx"> this._updateJumpToSymbolTrackingMode();
</span><span class="cx">
</span><span class="cx"> this._resetContent();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get focused()
</span><span class="cx"> {
</span><span class="cx"> return this._codeMirror.getWrapperElement().classList.contains("CodeMirror-focused");
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get alwaysShowPropertyNames()
</span><span class="cx"> {
</span><span class="cx"> return Object.keys(this._alwaysShowPropertyNames);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set alwaysShowPropertyNames(alwaysShowPropertyNames)
</span><span class="cx"> {
</span><span class="cx"> this._alwaysShowPropertyNames = (alwaysShowPropertyNames || []).keySet();
</span><span class="cx">
</span><span class="cx"> this._resetContent();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get showsImplicitProperties()
</span><span class="cx"> {
</span><span class="cx"> return this._showsImplicitProperties;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set showsImplicitProperties(showsImplicitProperties)
</span><span class="cx"> {
</span><span class="lines">@@ -161,12 +148,12 @@
</span><span class="cx"> this._showsImplicitProperties = showsImplicitProperties;
</span><span class="cx">
</span><span class="cx"> this._resetContent();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get sortProperties()
</span><span class="cx"> {
</span><span class="cx"> return this._sortProperties;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set sortProperties(sortProperties)
</span><span class="cx"> {
</span><span class="lines">@@ -176,32 +163,32 @@
</span><span class="cx"> this._sortProperties = sortProperties;
</span><span class="cx">
</span><span class="cx"> this._resetContent();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- focus: function()
</del><ins>+ focus()
</ins><span class="cx"> {
</span><span class="cx"> this._codeMirror.focus();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- refresh: function()
</del><ins>+ refresh()
</ins><span class="cx"> {
</span><span class="cx"> this._resetContent();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- updateLayout: function(force)
</del><ins>+ updateLayout(force)
</ins><span class="cx"> {
</span><span class="cx"> this._codeMirror.refresh();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // Protected
</span><span class="cx">
</span><del>- didDismissPopover: function(popover)
</del><ins>+ didDismissPopover(popover)
</ins><span class="cx"> {
</span><span class="cx"> if (popover === this._colorPickerPopover)
</span><span class="cx"> delete this._colorPickerPopover;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- completionControllerCompletionsHidden: function(completionController)
</del><ins>+ completionControllerCompletionsHidden(completionController)
</ins><span class="cx"> {
</span><span class="cx"> var styleText = this._style.text;
</span><span class="cx"> var currentText = this._formattedContent();
</span><span class="lines">@@ -213,20 +200,20 @@
</span><span class="cx"> this._commitChanges();
</span><span class="cx"> else
</span><span class="cx"> this._propertiesChanged();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // Private
</span><span class="cx">
</span><del>- _clearRemoveEditingLineClassesTimeout: function()
</del><ins>+ _clearRemoveEditingLineClassesTimeout()
</ins><span class="cx"> {
</span><span class="cx"> if (!this._removeEditingLineClassesTimeout)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> clearTimeout(this._removeEditingLineClassesTimeout);
</span><span class="cx"> delete this._removeEditingLineClassesTimeout;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _removeEditingLineClasses: function()
</del><ins>+ _removeEditingLineClasses()
</ins><span class="cx"> {
</span><span class="cx"> this._clearRemoveEditingLineClassesTimeout();
</span><span class="cx">
</span><span class="lines">@@ -238,16 +225,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> this._codeMirror.operation(removeEditingLineClasses.bind(this));
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _removeEditingLineClassesSoon: function()
</del><ins>+ _removeEditingLineClassesSoon()
</ins><span class="cx"> {
</span><span class="cx"> if (this._removeEditingLineClassesTimeout)
</span><span class="cx"> return;
</span><span class="cx"> this._removeEditingLineClassesTimeout = setTimeout(this._removeEditingLineClasses.bind(this), WebInspector.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _formattedContent: function()
</del><ins>+ _formattedContent()
</ins><span class="cx"> {
</span><span class="cx"> // Start with the prefix whitespace we stripped.
</span><span class="cx"> var content = this._prefixWhitespace;
</span><span class="lines">@@ -265,9 +252,9 @@
</span><span class="cx"> content += this._suffixWhitespace;
</span><span class="cx">
</span><span class="cx"> return content;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _commitChanges: function()
</del><ins>+ _commitChanges()
</ins><span class="cx"> {
</span><span class="cx"> if (this._commitChangesTimeout) {
</span><span class="cx"> clearTimeout(this._commitChangesTimeout);
</span><span class="lines">@@ -275,9 +262,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> this._style.text = this._formattedContent();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _editorBlured: function(codeMirror)
</del><ins>+ _editorBlured(codeMirror)
</ins><span class="cx"> {
</span><span class="cx"> // Clicking a suggestion causes the editor to blur. We don't want to reset content in this case.
</span><span class="cx"> if (this._completionController.isHandlingClickEvent())
</span><span class="lines">@@ -286,9 +273,9 @@
</span><span class="cx"> // Reset the content on blur since we stop accepting external changes while the the editor is focused.
</span><span class="cx"> // This causes us to pick up any change that was suppressed while the editor was focused.
</span><span class="cx"> this._resetContent();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _contentChanged: function(codeMirror, change)
</del><ins>+ _contentChanged(codeMirror, change)
</ins><span class="cx"> {
</span><span class="cx"> // Return early if the style isn't editable. This still can be called when readOnly is set because
</span><span class="cx"> // clicking on a color swatch modifies the text.
</span><span class="lines">@@ -309,15 +296,16 @@
</span><span class="cx"> // Use a short delay for user input to coalesce more changes before committing. Other actions like
</span><span class="cx"> // undo, redo and paste are atomic and work better with a zero delay. CodeMirror identifies changes that
</span><span class="cx"> // get coalesced in the undo stack with a "+" prefix on the origin. Use that to set the delay for our coalescing.
</span><del>- const delay = change.origin && change.origin.charAt(0) === "+" ? WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay : 0;
</del><ins>+ // FIXME: use const or let
+ var delay = change.origin && change.origin.charAt(0) === "+" ? WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay : 0;
</ins><span class="cx">
</span><span class="cx"> // Reset the timeout so rapid changes coalesce after a short delay.
</span><span class="cx"> if (this._commitChangesTimeout)
</span><span class="cx"> clearTimeout(this._commitChangesTimeout);
</span><span class="cx"> this._commitChangesTimeout = setTimeout(this._commitChanges.bind(this), delay);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _updateTextMarkers: function(nonatomic)
</del><ins>+ _updateTextMarkers(nonatomic)
</ins><span class="cx"> {
</span><span class="cx"> function update()
</span><span class="cx"> {
</span><span class="lines">@@ -349,7 +337,8 @@
</span><span class="cx">
</span><span class="cx"> if (!this._codeMirror.getOption("readOnly")) {
</span><span class="cx"> // Matches a comment like: /* -webkit-foo: bar; */
</span><del>- const commentedPropertyRegex = /\/\*\s*[-\w]+\s*:\s*[^;]+;?\s*\*\//g;
</del><ins>+ // FIXME: use const or let
+ var commentedPropertyRegex = /\/\*\s*[-\w]+\s*:\s*[^;]+;?\s*\*\//g;
</ins><span class="cx">
</span><span class="cx"> // Look for comments that look like properties and add checkboxes in front of them.
</span><span class="cx"> var lineCount = this._codeMirror.lineCount();
</span><span class="lines">@@ -388,9 +377,9 @@
</span><span class="cx"> update.call(this);
</span><span class="cx"> else
</span><span class="cx"> this._codeMirror.operation(update.bind(this));
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _createColorSwatches: function(nonatomic, lineNumber)
</del><ins>+ _createColorSwatches(nonatomic, lineNumber)
</ins><span class="cx"> {
</span><span class="cx"> function update()
</span><span class="cx"> {
</span><span class="lines">@@ -419,9 +408,9 @@
</span><span class="cx"> update.call(this);
</span><span class="cx"> else
</span><span class="cx"> this._codeMirror.operation(update.bind(this));
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _updateTextMarkerForPropertyIfNeeded: function(property)
</del><ins>+ _updateTextMarkerForPropertyIfNeeded(property)
</ins><span class="cx"> {
</span><span class="cx"> var textMarker = property.__propertyTextMarker;
</span><span class="cx"> console.assert(textMarker);
</span><span class="lines">@@ -434,9 +423,9 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> this._createTextMarkerForPropertyIfNeeded(range.from, range.to, property);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _createTextMarkerForPropertyIfNeeded: function(from, to, property)
</del><ins>+ _createTextMarkerForPropertyIfNeeded(from, to, property)
</ins><span class="cx"> {
</span><span class="cx"> if (!this._codeMirror.getOption("readOnly")) {
</span><span class="cx"> // Create a new checkbox element and marker.
</span><span class="lines">@@ -493,9 +482,9 @@
</span><span class="cx"> property.addEventListener(WebInspector.CSSProperty.Event.OverriddenStatusChanged, this._propertyOverriddenStatusChanged, this);
</span><span class="cx">
</span><span class="cx"> this._removeCheckboxPlaceholder(from.line);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _clearTextMarkers: function(nonatomic, all)
</del><ins>+ _clearTextMarkers(nonatomic, all)
</ins><span class="cx"> {
</span><span class="cx"> function clear()
</span><span class="cx"> {
</span><span class="lines">@@ -526,9 +515,9 @@
</span><span class="cx"> clear.call(this);
</span><span class="cx"> else
</span><span class="cx"> this._codeMirror.operation(clear.bind(this));
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _iterateOverProperties: function(onlyVisibleProperties, callback)
</del><ins>+ _iterateOverProperties(onlyVisibleProperties, callback)
</ins><span class="cx"> {
</span><span class="cx"> var properties = onlyVisibleProperties ? this._style.visibleProperties : this._style.properties;
</span><span class="cx">
</span><span class="lines">@@ -546,9 +535,9 @@
</span><span class="cx"> if (callback.call(this, properties[i], i === properties.length - 1))
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _propertyCheckboxChanged: function(event)
</del><ins>+ _propertyCheckboxChanged(event)
</ins><span class="cx"> {
</span><span class="cx"> var property = event.target.__cssProperty;
</span><span class="cx"> console.assert(property);
</span><span class="lines">@@ -578,9 +567,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> this._codeMirror.operation(update.bind(this));
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _propertyCommentCheckboxChanged: function(event)
</del><ins>+ _propertyCommentCheckboxChanged(event)
</ins><span class="cx"> {
</span><span class="cx"> var commentTextMarker = event.target.__commentTextMarker;
</span><span class="cx"> console.assert(commentTextMarker);
</span><span class="lines">@@ -612,9 +601,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> this._codeMirror.operation(update.bind(this));
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _colorSwatchClicked: function(event)
</del><ins>+ _colorSwatchClicked(event)
</ins><span class="cx"> {
</span><span class="cx"> if (this._colorPickerPopover)
</span><span class="cx"> return;
</span><span class="lines">@@ -715,14 +704,14 @@
</span><span class="cx">
</span><span class="cx"> colorPicker.color = color;
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _propertyOverriddenStatusChanged: function(event)
</del><ins>+ _propertyOverriddenStatusChanged(event)
</ins><span class="cx"> {
</span><span class="cx"> this._updateTextMarkerForPropertyIfNeeded(event.target);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _propertiesChanged: function(event)
</del><ins>+ _propertiesChanged(event)
</ins><span class="cx"> {
</span><span class="cx"> // Don't try to update the document while completions are showing. Doing so will clear
</span><span class="cx"> // the completion hint and prevent further interaction with the completion.
</span><span class="lines">@@ -738,9 +727,9 @@
</span><span class="cx"> this._removeEditingLineClassesSoon();
</span><span class="cx">
</span><span class="cx"> this._updateTextMarkers();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _markLinesWithCheckboxPlaceholder: function()
</del><ins>+ _markLinesWithCheckboxPlaceholder()
</ins><span class="cx"> {
</span><span class="cx"> if (this._codeMirror.getOption("readOnly"))
</span><span class="cx"> return;
</span><span class="lines">@@ -776,9 +765,9 @@
</span><span class="cx"> var placeholderMark = this._codeMirror.setUniqueBookmark(position, placeholderElement);
</span><span class="cx"> placeholderMark.__checkboxPlaceholder = true;
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _removeCheckboxPlaceholder: function(lineNumber)
</del><ins>+ _removeCheckboxPlaceholder(lineNumber)
</ins><span class="cx"> {
</span><span class="cx"> var marks = this._codeMirror.findMarksAt({line: lineNumber, ch: 0});
</span><span class="cx"> for (var i = 0; i < marks.length; ++i) {
</span><span class="lines">@@ -789,9 +778,9 @@
</span><span class="cx"> mark.clear();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _resetContent: function()
</del><ins>+ _resetContent()
</ins><span class="cx"> {
</span><span class="cx"> if (this._commitChangesTimeout) {
</span><span class="cx"> clearTimeout(this._commitChangesTimeout);
</span><span class="lines">@@ -957,9 +946,9 @@
</span><span class="cx"> this._ignoreCodeMirrorContentDidChangeEvent = true;
</span><span class="cx"> this._codeMirror.operation(update.bind(this));
</span><span class="cx"> delete this._ignoreCodeMirrorContentDidChangeEvent;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _updateJumpToSymbolTrackingMode: function()
</del><ins>+ _updateJumpToSymbolTrackingMode()
</ins><span class="cx"> {
</span><span class="cx"> var oldJumpToSymbolTrackingModeEnabled = this._jumpToSymbolTrackingModeEnabled;
</span><span class="cx">
</span><span class="lines">@@ -977,9 +966,9 @@
</span><span class="cx"> this._tokenTrackingController.enabled = false;
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- tokenTrackingControllerHighlightedRangeWasClicked: function(tokenTrackingController)
</del><ins>+ tokenTrackingControllerHighlightedRangeWasClicked(tokenTrackingController)
</ins><span class="cx"> {
</span><span class="cx"> console.assert(this._style.ownerRule.sourceCodeLocation);
</span><span class="cx"> if (!this._style.ownerRule.sourceCodeLocation)
</span><span class="lines">@@ -1009,12 +998,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WebInspector.resourceSidebarPanel.showSourceCodeLocation(sourceCodeLocation);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- tokenTrackingControllerNewHighlightCandidate: function(tokenTrackingController, candidate)
</del><ins>+ tokenTrackingControllerNewHighlightCandidate(tokenTrackingController, candidate)
</ins><span class="cx"> {
</span><span class="cx"> this._tokenTrackingController.highlightRange(candidate.hoveredTokenRange);
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-WebInspector.CSSStyleDeclarationTextEditor.prototype.__proto__ = WebInspector.Object.prototype;
</del><ins>+WebInspector.CSSStyleDeclarationTextEditor.StyleClassName = "css-style-text-editor";
+WebInspector.CSSStyleDeclarationTextEditor.ReadOnlyStyleClassName = "read-only";
+WebInspector.CSSStyleDeclarationTextEditor.ColorSwatchElementStyleClassName = "color-swatch";
+WebInspector.CSSStyleDeclarationTextEditor.CheckboxPlaceholderElementStyleClassName = "checkbox-placeholder";
+WebInspector.CSSStyleDeclarationTextEditor.EditingLineStyleClassName = "editing-line";
+WebInspector.CSSStyleDeclarationTextEditor.CommitCoalesceDelay = 250;
+WebInspector.CSSStyleDeclarationTextEditor.RemoveEditingLineClassesDelay = 2000;
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>