You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2010/06/21 09:56:52 UTC

svn commit: r956480 - /myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js

Author: werpu
Date: Mon Jun 21 07:56:52 2010
New Revision: 956480

URL: http://svn.apache.org/viewvc?rev=956480&view=rev
Log:
http://issues.apache.org/jira/browse/MYFACES-2765

Modified:
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js?rev=956480&r1=956479&r2=956480&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js Mon Jun 21 07:56:52 2010
@@ -194,7 +194,7 @@ myfaces._impl.core._Runtime.singletonExt
             parentNode = item.parentNode;
 
             //evalNode = fragment.childNodes[0];
-            evalNodes = (fragment.childNodes) ? _Lang.objToArray(fragment.childNodes): fragment;
+            evalNodes = (fragment.childNodes) ? _Lang.objToArray(fragment.childNodes) : fragment;
             parentNode.replaceChild(fragment, item);
         }
         return evalNodes;
@@ -274,6 +274,7 @@ myfaces._impl.core._Runtime.singletonExt
      * @param itemId the identifier of the item
      */
     findById : function(fragment, itemId) {
+        //we have to escape here
 
         if (fragment === document) {
             return this.byId(itemId);
@@ -282,6 +283,10 @@ myfaces._impl.core._Runtime.singletonExt
         if (fragment.nodeType == 1 && fragment.querySelector) {
             //we can use the query selector here
             if (fragment.id && fragment.id === itemId) return fragment;
+            if (myfaces._impl._util._Lang.isString(itemId)) {
+                itemId = itemId.replace(/\./g, "\\.");
+            }
+
             return fragment.querySelector("#" + itemId);
         }
 
@@ -393,6 +398,9 @@ myfaces._impl.core._Runtime.singletonExt
 
             //html 5 selector
             if (deepScan && fragment.querySelectorAll) {
+                if (_Lang.isString(tagName)) {
+                    tagName = tagName.replace(/\./g, "\\.");
+                }
                 var result = fragment.querySelectorAll(tagName);
                 if (fragment.nodeType == 1 && filter(fragment)) {
                     result = (result == null) ? [] : _Lang.objToArray(result);
@@ -420,6 +428,9 @@ myfaces._impl.core._Runtime.singletonExt
             deepScan = !!deepScan;
 
             if (deepScan && fragment.querySelectorAll) {
+                if (_Lang.isString(name)) {
+                    name = name.replace(/\./g, "\\.");
+                }
                 var result = fragment.querySelectorAll("[name=" + name + "]");
                 if (fragment.nodeType == 1 && filter(fragment)) {
                     result = (result == null) ? [] : _Lang.objToArray(result);