https://bugs.webkit.org/show_bug.cgi?id=109552
Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-02-12
Reviewed by Vsevolod Vlasov.
Source/WebCore:
Remove "show whitespace" setting and add it to experiments.
No new tests: fixed an existing test to verify changes.
* English.lproj/localizedStrings.js:
* inspector/front-end/DefaultTextEditor.js:
(WebInspector.TextEditorMainPanel):
(WebInspector.TextEditorMainPanel.prototype.wasShown):
(WebInspector.TextEditorMainPanel.prototype.willHide):
* inspector/front-end/Settings.js:
(WebInspector.ExperimentsSettings):
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):
LayoutTests:
Fix layout test to switch on experiment instead of toggling one of the
options.
* inspector/editor/text-editor-show-whitespace-expected.txt:
* inspector/editor/text-editor-show-whitespace.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142597
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-02-12 Andrey Lushnikov <lushnikov@chromium.org>
+
+ Web Inspector: move showWhitespace option into experiments
+ https://bugs.webkit.org/show_bug.cgi?id=109552
+
+ Reviewed by Vsevolod Vlasov.
+
+ Fix layout test to switch on experiment instead of toggling one of the
+ options.
+
+ * inspector/editor/text-editor-show-whitespace-expected.txt:
+ * inspector/editor/text-editor-show-whitespace.html:
+
2013-02-11 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: stack trace is cut at native bind if inspector is closed
-This test checks how text editor splits whitespace sequences to highlight them if the appropriate setting is set up.
+This test checks how text editor splits whitespace sequences to highlight them if the appropriate experiment is switched on.
Actual text:
function foo(a, b) {
a = "string with spaces";
a = 2; a = 3;
}
-========== Editor HTML showWhitespaceInEditor OFF ==========
-
-<div class="inner-container" tabindex="0">
-<div class="webkit-line-content"><span class="webkit-javascript-keyword">function</span><span class="webkit-whitespace"> </span><span class="webkit-javascript-ident">foo</span>(<span class="webkit-javascript-ident">a</span>,<span class="webkit-whitespace"> </span><span class="webkit-javascript-ident">b</span>)<span class="webkit-whitespace"> </span>{</div>
-<div class="webkit-line-content"><span class="webkit-whitespace"> </span><span class="webkit-javascript-comment">// spaces in comment</span></div>
-<div class="webkit-line-content"><span class="webkit-whitespace"> </span><span class="webkit-javascript-ident">a</span><span class="webkit-whitespace"> </span>=<span class="webkit-whitespace"> </span><span class="webkit-javascript-string">"string with spaces"</span>;</div>
-<div class="webkit-line-content"><span class="webkit-whitespace"> </span><span class="webkit-javascript-ident">a</span><span class="webkit-whitespace"> </span>=<span class="webkit-whitespace"> </span><span class="webkit-javascript-number">2</span>;<span class="webkit-whitespace"> </span><span class="webkit-javascript-ident">a</span><span class="webkit-whitespace"> </span>=<span class="webkit-whitespace"> </span><span class="webkit-javascript-number">3</span>;</div>
-<div class="webkit-line-content">}</div></div>
========== Editor HTML after setting showWhitespaceInEditor ON ==========
<div class="inner-container" tabindex="0">
a = 2; a = 3;
}
- WebInspector.settings.showWhitespaceInEditor.set(false);
+ WebInspector.experimentsSettings.showWhitespaceInEditor.enableForTest();
var textEditor = InspectorTest.createTestEditor();
textEditor.overrideViewportForTest(0, undefined, 3);
textEditor.mimeType = "text/javascript";
textEditor.setText(foo.toString());
InspectorTest.addResult("Actual text:");
InspectorTest.addResult(textEditor.text());
- InspectorTest.addResult("========== Editor HTML showWhitespaceInEditor OFF ==========");
- InspectorTest.dumpEditorHTML(textEditor, true);
- WebInspector.settings.showWhitespaceInEditor.set(true);
InspectorTest.addResult("========== Editor HTML after setting showWhitespaceInEditor ON ==========");
InspectorTest.dumpEditorHTML(textEditor, true);
InspectorTest.completeTest();
<body onload="runTest();">
<p>
This test checks how text editor splits whitespace sequences to highlight them if the appropriate
-setting is set up.
+experiment is switched on.
</p>
</body>
</html>
+2013-02-12 Andrey Lushnikov <lushnikov@chromium.org>
+
+ Web Inspector: move showWhitespace option into experiments
+ https://bugs.webkit.org/show_bug.cgi?id=109552
+
+ Reviewed by Vsevolod Vlasov.
+
+ Remove "show whitespace" setting and add it to experiments.
+
+ No new tests: fixed an existing test to verify changes.
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/DefaultTextEditor.js:
+ (WebInspector.TextEditorMainPanel):
+ (WebInspector.TextEditorMainPanel.prototype.wasShown):
+ (WebInspector.TextEditorMainPanel.prototype.willHide):
+ * inspector/front-end/Settings.js:
+ (WebInspector.ExperimentsSettings):
+ * inspector/front-end/SettingsScreen.js:
+ (WebInspector.GenericSettingsTab):
+
2013-02-12 Tamas Czene <tczene@inf.u-szeged.hu>
Add error checking into OpenCL version of SVG filters.
localizedStrings["Show Shadow DOM"] = "Show Shadow DOM";
localizedStrings["Show times as percentages."] = "Show times as percentages.";
localizedStrings["Show total and self times as percentages."] = "Show total and self times as percentages.";
-localizedStrings["Show whitespace"] = "Show whitespace";
localizedStrings["Size"] = "Size";
localizedStrings["Snapshot %d"] = "Snapshot %d";
localizedStrings["End Time"] = "End Time";
this.element.addEventListener("textInput", this._handleTextInput.bind(this), false);
this.element.addEventListener("cut", this._handleCut.bind(this), false);
- this._showWhitespace = WebInspector.settings.showWhitespaceInEditor.get();
- this._handleShowWhitespaceInEditorChange = this._handleShowWhitespaceInEditorChange.bind(this);
+ this._showWhitespace = WebInspector.experimentsSettings.showWhitespaceInEditor.isEnabled();
this._container.addEventListener("focus", this._handleFocused.bind(this), false);
return true;
},
- _handleShowWhitespaceInEditorChange: function()
- {
- this._showWhitespace = WebInspector.settings.showWhitespaceInEditor.get();
- var visibleFrom = this.scrollTop();
- var visibleTo = visibleFrom + this.clientHeight();
-
- if (!visibleTo)
- return;
-
- var result = this.findVisibleChunks(visibleFrom, visibleTo);
- var startLine = this._textChunks[result.start].startLine;
- var endLine = this._textChunks[result.end - 1].startLine + this._textChunks[result.end - 1].linesCount;
- this._paintLines(startLine, endLine + 1);
- },
-
/**
* @param {string} regex
* @param {string} cssClass
wasShown: function()
{
- WebInspector.settings.showWhitespaceInEditor.addChangeListener(this._handleShowWhitespaceInEditorChange);
-
this._boundSelectionChangeListener = this._handleSelectionChange.bind(this);
document.addEventListener("selectionchange", this._boundSelectionChangeListener, false);
willHide: function()
{
- WebInspector.settings.showWhitespaceInEditor.removeChangeListener(this._handleShowWhitespaceInEditorChange);
-
document.removeEventListener("selectionchange", this._boundSelectionChangeListener, false);
delete this._boundSelectionChangeListener;
this.deviceOrientationOverride = this.createSetting("deviceOrientationOverride", "");
this.showHeapSnapshotObjectsHiddenProperties = this.createSetting("showHeaSnapshotObjectsHiddenProperties", false);
this.showNativeSnapshotUninstrumentedSize = this.createSetting("showNativeSnapshotUninstrumentedSize", false);
- this.showWhitespaceInEditor = this.createSetting("showWhitespaceInEditor", false);
this.searchInContentScripts = this.createSetting("searchInContentScripts", false);
this.textEditorIndent = this.createSetting("textEditorIndent", " ");
this.lastDockState = this.createSetting("lastDockState", "");
this.showOverridesInDrawer = this._createExperiment("showOverridesInDrawer", "Show Overrides in drawer");
this.fileSystemProject = this._createExperiment("fileSystemProject", "File system folders in Sources Panel");
this.horizontalPanelSplit = this._createExperiment("horizontalPanelSplit", "Allow horizontal split in Elements and Sources panels");
+ this.showWhitespaceInEditor = this._createExperiment("showWhitespaceInEditor", "Show whitespace characters in editor");
this._cleanUpSetting();
}
p = this._appendSection(WebInspector.UIString("Sources"));
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Search in content scripts"), WebInspector.settings.searchInContentScripts));
- p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Show whitespace"), WebInspector.settings.showWhitespaceInEditor));
p.appendChild(this._createCheckboxSetting(WebInspector.UIString("Enable source maps"), WebInspector.settings.sourceMapsEnabled));
if (WebInspector.experimentsSettings.isEnabled("sass"))
p.appendChild(this._createCSSAutoReloadControls());