WICKET-5510 Avoid using jQuery.text() when possible. It is very slow in IE

(cherry picked from commit 36d1901cf556e9d1941a0a662ac2c3735ed8e6a5)


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b27019fb
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b27019fb
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b27019fb

Branch: refs/heads/sandbox/component-queueing-2
Commit: b27019fb059ae92b2f55afebdda905ea2f8f69da
Parents: c78379f
Author: Martin Tzvetanov Grigorov <[email protected]>
Authored: Tue Feb 18 10:21:57 2014 +0200
Committer: Martin Tzvetanov Grigorov <[email protected]>
Committed: Tue Feb 18 10:24:36 2014 +0200

----------------------------------------------------------------------
 .../apache/wicket/ajax/res/js/wicket-ajax-jquery.js   | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/b27019fb/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js 
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index bbe1797..43ff3a4 100644
--- 
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ 
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -1027,6 +1027,8 @@
                        context.steps.push(function (notify) {
                                // get the component id
                                var compId = node.getAttribute("id");
+
+                               // get existing component
                                var element = Wicket.$(compId);
 
                                if (isUndef(element)) {
@@ -1034,7 +1036,7 @@
                                                compId + "]] was not found 
while trying to perform markup update. " +
                                                "Make sure you called 
component.setOutputMarkupId(true) on the component whose markup you are trying 
to update.");
                                } else {
-                                       var text = jQuery(node).text();
+                                       var text = Wicket.DOM.text(node);
 
                                        // if the text was escaped, unescape it
                                        // (escaping is done when the component 
body contains a CDATA section)
@@ -1146,7 +1148,7 @@
 
                // Adds a closure that processes a redirect
                processRedirect: function (context, node) {
-                       var text = jQuery(node).text();
+                       var text = Wicket.DOM.text(node);
                        Wicket.Log.info("Redirecting to: " + text);
                        window.location = text;
                },
@@ -1748,8 +1750,10 @@
                        },
 
                        /**
-                        * Reads the text from the node's children nodes
-                        * @param node the root node
+                        * Reads the text from the node's children nodes.
+                        * Used instead of jQuery.text() because it is very 
slow in IE10/11.
+                        * WICKET-5132, WICKET-5510
+                        * @param node {DOMElement} the root node
                         */
                        text: function (node) {
                                if (isUndef(node)) {
@@ -1913,7 +1917,7 @@
                                        // need to replace that first
 
                                        // get the header contribution text and 
unescape it if necessary
-                                       var text = jQuery(headerNode).text();
+                                       var text = Wicket.DOM.text(headerNode);
                                        var encoding = 
headerNode.getAttribute("encoding");
 
                                        if (encoding !== null && encoding !== 
"") {

Reply via email to