Title: [135683] trunk/Source/WebCore
Revision
135683
Author
[email protected]
Date
2012-11-25 22:35:57 -0800 (Sun, 25 Nov 2012)

Log Message

Web Inspector: use native Element.prototype.normalize instead of custom defined Element.prototype.pruneEmptyTextNodes
https://bugs.webkit.org/show_bug.cgi?id=103205

Patch by Nikita Vasilyev <[email protected]> on 2012-11-25
Reviewed by Pavel Feldman.

* inspector/front-end/DOMExtension.js:
* inspector/front-end/TextPrompt.js:
(WebInspector.TextPrompt.prototype.clearAutoComplete):
(WebInspector.TextPrompt.prototype._completionsReady):
(WebInspector.TextPrompt.prototype.applySuggestion):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (135682 => 135683)


--- trunk/Source/WebCore/ChangeLog	2012-11-26 06:33:08 UTC (rev 135682)
+++ trunk/Source/WebCore/ChangeLog	2012-11-26 06:35:57 UTC (rev 135683)
@@ -1,5 +1,18 @@
 2012-11-25  Nikita Vasilyev  <[email protected]>
 
+        Web Inspector: use native Element.prototype.normalize instead of custom defined Element.prototype.pruneEmptyTextNodes
+        https://bugs.webkit.org/show_bug.cgi?id=103205
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/DOMExtension.js:
+        * inspector/front-end/TextPrompt.js:
+        (WebInspector.TextPrompt.prototype.clearAutoComplete):
+        (WebInspector.TextPrompt.prototype._completionsReady):
+        (WebInspector.TextPrompt.prototype.applySuggestion):
+
+2012-11-25  Nikita Vasilyev  <[email protected]>
+
         Web Inspector: remove unused DOM methods
         https://bugs.webkit.org/show_bug.cgi?id=103204
 

Modified: trunk/Source/WebCore/inspector/front-end/DOMExtension.js (135682 => 135683)


--- trunk/Source/WebCore/inspector/front-end/DOMExtension.js	2012-11-26 06:33:08 UTC (rev 135682)
+++ trunk/Source/WebCore/inspector/front-end/DOMExtension.js	2012-11-26 06:35:57 UTC (rev 135683)
@@ -183,17 +183,6 @@
         this.style.removeProperty("top");
 }
 
-Element.prototype.pruneEmptyTextNodes = function()
-{
-    var sibling = this.firstChild;
-    while (sibling) {
-        var nextSibling = sibling.nextSibling;
-        if (sibling.nodeType === Node.TEXT_NODE && sibling.nodeValue === "")
-            this.removeChild(sibling);
-        sibling = nextSibling;
-    }
-}
-
 Element.prototype.isScrolledToBottom = function()
 {
     // This code works only for 0-width border

Modified: trunk/Source/WebCore/inspector/front-end/TextPrompt.js (135682 => 135683)


--- trunk/Source/WebCore/inspector/front-end/TextPrompt.js	2012-11-26 06:33:08 UTC (rev 135682)
+++ trunk/Source/WebCore/inspector/front-end/TextPrompt.js	2012-11-26 06:35:57 UTC (rev 135683)
@@ -327,7 +327,7 @@
             return;
 
         this._userEnteredRange.deleteContents();
-        this._element.pruneEmptyTextNodes();
+        this._element.normalize();
 
         var userTextNode = document.createTextNode(this._userEnteredText);
         this._userEnteredRange.insertNode(userTextNode);
@@ -500,7 +500,7 @@
         if (auto) {
             if (this.isCaretAtEndOfPrompt()) {
                 this._userEnteredRange.deleteContents();
-                this._element.pruneEmptyTextNodes();
+                this._element.normalize();
                 var finalSelectionRange = document.createRange();
                 var prefixText = completionText.substring(0, wordPrefixLength);
                 var suffixText = completionText.substring(wordPrefixLength);
@@ -549,7 +549,7 @@
             wordPrefixLength = this._userEnteredText ? this._userEnteredText.length : 0;
 
         this._userEnteredRange.deleteContents();
-        this._element.pruneEmptyTextNodes();
+        this._element.normalize();
         var finalSelectionRange = document.createRange();
         var completionTextNode = document.createTextNode(completionText);
         this._userEnteredRange.insertNode(completionTextNode);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to