[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
timothy at apple.com
timothy at apple.com
Wed Jan 20 22:26:52 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit ccc7f76c79fda1f089cd1451a532c37c6e33a4a9
Author: timothy at apple.com <timothy at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Jan 16 23:30:01 2010 +0000
Use String.trim() instead of a regex in the Web Inspector.
https://bugs.webkit.org/show_bug.cgi?id=33765
Reviewed by George Staikos.
* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel.prototype.performSearch): Use .trim().
* inspector/front-end/ObjectPropertiesSection.js:
(WebInspector.ObjectPropertyTreeElement.prototype.applyExpression): Ditto.
* inspector/front-end/ProfileView.js:
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame.prototype._evalSelectionInCallFrame): Ditto.
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylePropertyTreeElement.prototype): Ditto.
* inspector/front-end/utilities.js:
(String.prototype.trimLeadingWhitespace): Removed.
(String.prototype.trimTrailingWhitespace): Removed.
(String.prototype.trimWhitespace): Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f438f67..c8c6421 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-01-16 Timothy Hatcher <timothy at apple.com>
+
+ Use String.trim() instead of a regex in the Web Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33765
+
+ Reviewed by George Staikos.
+
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.performSearch): Use .trim().
+ * inspector/front-end/ObjectPropertiesSection.js:
+ (WebInspector.ObjectPropertyTreeElement.prototype.applyExpression): Ditto.
+ * inspector/front-end/ProfileView.js:
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype._evalSelectionInCallFrame): Ditto.
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype): Ditto.
+ * inspector/front-end/utilities.js:
+ (String.prototype.trimLeadingWhitespace): Removed.
+ (String.prototype.trimTrailingWhitespace): Removed.
+ (String.prototype.trimWhitespace): Removed.
+
2010-01-16 Oliver Hunt <oliver at apple.com>
Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 93dd700..1e64df0 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -265,7 +265,7 @@ WebInspector.ElementsPanel.prototype = {
// Call searchCanceled since it will reset everything we need before doing a new search.
this.searchCanceled();
- const whitespaceTrimmedQuery = query.trimWhitespace();
+ const whitespaceTrimmedQuery = query.trim();
if (!whitespaceTrimmedQuery.length)
return;
diff --git a/WebCore/inspector/front-end/ObjectPropertiesSection.js b/WebCore/inspector/front-end/ObjectPropertiesSection.js
index fcfd4cf..0f9dcec 100644
--- a/WebCore/inspector/front-end/ObjectPropertiesSection.js
+++ b/WebCore/inspector/front-end/ObjectPropertiesSection.js
@@ -233,7 +233,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
applyExpression: function(expression, updateInterface)
{
- expression = expression.trimWhitespace();
+ expression = expression.trim();
var expressionLength = expression.length;
var self = this;
var callback = function(success) {
@@ -251,7 +251,7 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
self.updateSiblings();
}
};
- InjectedScriptAccess.setPropertyValue(this.property.parentObjectProxy, this.property.name, expression.trimWhitespace(), callback);
+ InjectedScriptAccess.setPropertyValue(this.property.parentObjectProxy, this.property.name, expression.trim(), callback);
}
}
diff --git a/WebCore/inspector/front-end/ProfileView.js b/WebCore/inspector/front-end/ProfileView.js
index 9ced869..1efa0dc 100644
--- a/WebCore/inspector/front-end/ProfileView.js
+++ b/WebCore/inspector/front-end/ProfileView.js
@@ -233,7 +233,7 @@ WebInspector.CPUProfileView.prototype = {
// Call searchCanceled since it will reset everything we need before doing a new search.
this.searchCanceled();
- query = query.trimWhitespace();
+ query = query.trim();
if (!query.length)
return;
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index 77b25c4..a0c09ad 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -444,7 +444,7 @@ WebInspector.SourceFrame.prototype = {
if (!selection.rangeCount)
return;
- var expression = selection.getRangeAt(0).toString().trimWhitespace();
+ var expression = selection.getRangeAt(0).toString().trim();
WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", function(result, exception) {
WebInspector.showConsole();
var commandMessage = new WebInspector.ConsoleCommand(expression);
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index a6f23b5..1b5ffbc 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -1310,7 +1310,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
{
var section = this.treeOutline.section;
var elementsPanel = WebInspector.panels.elements;
- var styleTextLength = styleText.trimWhitespace().length;
+ var styleTextLength = styleText.trim().length;
if (!styleTextLength && updateInterface) {
if (this._newProperty) {
// The user deleted everything, so remove the tree element and update.
@@ -1361,7 +1361,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
WebInspector.panels.elements.treeOutline.update();
}
- InjectedScriptAccess.applyStyleText(this.style.id, styleText.trimWhitespace(), this.name, callback);
+ InjectedScriptAccess.applyStyleText(this.style.id, styleText.trim(), this.name, callback);
}
}
diff --git a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
index 81d6106..1dba3f8 100644
--- a/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
+++ b/WebCore/inspector/front-end/WatchExpressionsSidebarPane.js
@@ -242,7 +242,7 @@ WebInspector.WatchExpressionTreeElement.prototype = {
if (WebInspector.isBeingEdited(this.nameElement) || !this.treeOutline.section.editable)
return;
- this.nameElement.textContent = this.property.name.trimWhitespace();
+ this.nameElement.textContent = this.property.name.trim();
var context = { expanded: this.expanded };
@@ -265,7 +265,7 @@ WebInspector.WatchExpressionTreeElement.prototype = {
applyExpression: function(expression, updateInterface)
{
- expression = expression.trimWhitespace();
+ expression = expression.trim();
if (!expression)
expression = null;
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index 4751459..d54005a 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -333,21 +333,6 @@ String.prototype.collapseWhitespace = function()
return this.replace(/[\s\xA0]+/g, " ");
}
-String.prototype.trimLeadingWhitespace = function()
-{
- return this.replace(/^[\s\xA0]+/g, "");
-}
-
-String.prototype.trimTrailingWhitespace = function()
-{
- return this.replace(/[\s\xA0]+$/g, "");
-}
-
-String.prototype.trimWhitespace = function()
-{
- return this.replace(/^[\s\xA0]+|[\s\xA0]+$/g, "");
-}
-
String.prototype.trimURL = function(baseURLDomain)
{
var result = this.replace(/^https?:\/\//i, "");
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list