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 2017/10/16 07:16:42 UTC

svn commit: r1812246 - in /myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl: _util/_DomQuirks.js xhrCore/_AjaxResponse.js

Author: werpu
Date: Mon Oct 16 07:16:42 2017
New Revision: 1812246

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

Fixing a Firefox warning and a small js scoping issue

Modified:
    myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
    myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js

Modified: myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js?rev=1812246&r1=1812245&r2=1812246&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js (original)
+++ myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js Mon Oct 16 07:16:42 2017
@@ -373,14 +373,18 @@ if (_MF_SINGLTN) {
                 return v.value;	//	string
             }
 
-            // this should work on Opera 7, but it's a little on the crashy side
-            if ((node.getAttributeNode) && (node.getAttributeNode(ta))) {
-                return (node.getAttributeNode(ta)).value;	//	string
-            } else if (node.getAttribute(ta)) {
+
+
+            if (node.getAttribute(ta)) {
                 return node.getAttribute(ta);	//	string
             } else if (node.getAttribute(ta.toLowerCase())) {
                 return node.getAttribute(ta.toLowerCase());	//	string
+
             }
+            //there used to be a getAttributeNode check here for really old
+            //browsers, I had to remove it because of a firefox warning
+            //which uses a regexp scan for this method to be deprecated
+
             return null;	//	string
         },
 

Modified: myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js?rev=1812246&r1=1812245&r2=1812246&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js (original)
+++ myfaces/core/branches/2.3.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js Mon Oct 16 07:16:42 2017
@@ -227,7 +227,8 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse",
     _applyJSFArtifactValueToForm: function (context, theForm, value, identifier) {
 
         if (!theForm) return;
-
+        var _Lang = this._Lang;
+        var _Dom = this._Dom;
         var prefix = this._getPrefix(context);
 
         //in IE7 looking up form elements with complex names (such as 'javax.faces.ViewState') fails in certain cases
@@ -243,15 +244,15 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse",
         }
 
         if (fieldsFound.length) {
-            this._Lang.arrForEach(fieldsFound, function (fieldFound) {
-                this._Dom.setAttribute(fieldFound, "value", value);
+            _Lang.arrForEach(fieldsFound, function (fieldFound) {
+                _Dom.setAttribute(fieldFound, "value", value);
             });
         } else {
             var element = this._Dom.getDummyPlaceHolder();
 
             //per JSF 2.3 spec the identifier of the element must be unique in the dom tree
             //otherwise we will break the html spec here
-            element.innerHTML = ["<input type='hidden'", "id='", this._fetchUniqueId(prefix, identifier), "' name='", identifier, "' value='", value, "' />"].join("");
+            element.innerHTML = ["<input type='hidden'", "id='", this._fetchUniqueId(prefix, identifier), "' name='", prefix + identifier, "' value='", value, "' />"].join("");
             //now we go to proper dom handling after having to deal with another ie screwup
             try {
                 theForm.appendChild(element.childNodes[0]);
@@ -310,7 +311,7 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse",
         this._Lang.arrForEach(forms, this._Lang.hitch(this, function (elem) {
             //update all forms which start with prefix (all render and execute targets
 
-                this._applyJSFArtifactValueToForm(context, elem, value, identifier);
+            this._applyJSFArtifactValueToForm(context, elem, value, identifier);
 
         }));
     },