You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/08/23 00:49:43 UTC

svn commit: r1160481 [1/2] - in /myfaces/shared/trunk_4.0.x/core/src/main: java/org/apache/myfaces/shared/application/ java/org/apache/myfaces/shared/config/ java/org/apache/myfaces/shared/renderkit/ java/org/apache/myfaces/shared/renderkit/html/ java/...

Author: lu4242
Date: Mon Aug 22 22:49:42 2011
New Revision: 1160481

URL: http://svn.apache.org/viewvc?rev=1160481&view=rev
Log:
synch changes done in myfaces-impl-shared

Added:
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java
Modified:
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGroupRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/resource/ResourceImpl.java
    myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/util/StateUtils.java
    myfaces/shared/trunk_4.0.x/core/src/main/resources/META-INF/myfaces-metadata.xml

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java Mon Aug 22 22:49:42 2011
@@ -51,10 +51,17 @@ public class DefaultViewHandlerSupport i
     //private static final Log log = LogFactory.getLog(DefaultViewHandlerSupport.class);
     private static final Logger log = Logger.getLogger(DefaultViewHandlerSupport.class.getName());
 
+    /**
+     * Controls the size of the cache used to "remember" if a view exists or not.
+     */
     @JSFWebConfigParam(defaultValue = "500", since = "2.0.2")
     private static final String CHECKED_VIEWID_CACHE_SIZE_ATTRIBUTE = "org.apache.myfaces.CHECKED_VIEWID_CACHE_SIZE";
     private static final int CHECKED_VIEWID_CACHE_DEFAULT_SIZE = 500;
 
+    /**
+     * Enable or disable a cache used to "remember" if a view exists or not and reduce the impact of
+     * sucesive calls to ExternalContext.getResource().
+     */
     @JSFWebConfigParam(defaultValue = "true", since = "2.0.2")
     private static final String CHECKED_VIEWID_CACHE_ENABLED_ATTRIBUTE = "org.apache.myfaces.CHECKED_VIEWID_CACHE_ENABLED";
     private static final boolean CHECKED_VIEWID_CACHE_ENABLED_DEFAULT = true;
@@ -278,9 +285,9 @@ public class DefaultViewHandlerSupport i
     protected String[] getFaceletsViewMappings(FacesContext context)
     {
         String faceletsViewMappings= context.getExternalContext().getInitParameter(ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME);
-        if(faceletsViewMappings == null)    //consider alias facelets.VIEWMAPPINGS
+        if(faceletsViewMappings == null)    //consider alias facelets.VIEW_MAPPINGS
         {
-            faceletsViewMappings= context.getExternalContext().getInitParameter("facelets.VIEWMAPPINGS");
+            faceletsViewMappings= context.getExternalContext().getInitParameter("facelets.VIEW_MAPPINGS");
         }
         
         return faceletsViewMappings == null ? null : faceletsViewMappings.split(";");

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java Mon Aug 22 22:49:42 2011
@@ -102,7 +102,7 @@ public class MyfacesConfig
      * StreamingAddResource instead of DefaultAddResource if you want to
      * gain performance.
      */
-    @JSFWebConfigParam(defaultValue="org.apache.myfaces.renderkit.html.util.DefaultAddResource",since="1.1")
+    @JSFWebConfigParam(defaultValue="org.apache.myfaces. renderkit.html.util. DefaultAddResource",since="1.1")
     private static final String INIT_PARAM_ADD_RESOURCE_CLASS = "org.apache.myfaces.ADD_RESOURCE_CLASS";
     private static final String INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT = "org.apache.myfaces.renderkit.html.util.DefaultAddResource";
 
@@ -192,26 +192,34 @@ public class MyfacesConfig
     private static final String INIT_PARAM_DELEGATE_FACES_SERVLET = "org.apache.myfaces.DELEGATE_FACES_SERVLET";
 
     /**
-     * This param is only valid when partial state saving is on.
-     * If this is set as true, the tag-handlers are reapplied like in facelets 1.1.x, allowing
+     * Indicate if the facelet associated to the view should be reapplied when the view is refreshed. Default mode is "auto".
+     * 
+     * <p>This param is only valid when partial state saving is on.
+     * If this is set as true, the tag-handlers are always reapplied before render view, like in facelets 1.1.x, allowing
      * c:if work correctly to "toggle" components based on a value changed on invoke application phase. 
+     * If the param is set as "auto", the implementation check if c:if, c:forEach, 
+     * c:choose and ui:include with src=ELExpression is used on the page and if that so, mark the view
+     * to be refreshed.</p> 
      */
     @JSFWebConfigParam(since="2.0", defaultValue="auto", expectedValues="true,false,auto")
     public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS = "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS"; 
     public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_DEFAULT = "auto";
 
     /**
-     * This param is only valid when partial state saving is on.
+     * Enable or disable a special mode that enable full state for parent components containing c:if, c:forEach, 
+     * c:choose and ui:include with src=ELExpression. By default is disabled(false).
+     * 
+     * <p>This param is only valid when partial state saving is on.
      * If this is set as true, parent components containing  c:if, c:forEach, 
-     * c:choose and ui:insert with src=ELExpression are marked to be restored fully, so state
-     * is preserved between request.
+     * c:choose and ui:include with src=ELExpression are marked to be restored fully, so state
+     * is preserved between request.</p>
      */
     @JSFWebConfigParam(since="2.0", defaultValue="false")
     public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE = "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE";
     public final static boolean INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT = false;
     
     /**
-     * if set to <code>true</code>, tag library XML files and faces config XML files using schema 
+     * If set to <code>true</code>, tag library XML files and faces config XML files using schema 
      * will be validated during application start up
      */
     @JSFWebConfigParam(since="2.0", expectedValues="true,false")

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java Mon Aug 22 22:49:42 2011
@@ -124,6 +124,10 @@ public final class RendererUtils
         getPathToComponent(component,buf);
 
         buf.insert(0,"{Component-Path : ");
+        Object location = component.getAttributes().get(UIComponent.VIEW_LOCATION_KEY);
+        if (location != null) {
+            buf.append(" Location: ").append(location);
+        }
         buf.append("}");
 
         return buf.toString();

Added: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java?rev=1160481&view=auto
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java (added)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java Mon Aug 22 22:49:42 2011
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.shared.renderkit.html;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * This is a list of the most common properties used by a JSF html
+ * component, organized by interfaces.
+ * 
+ * This is a copy from javax.faces.component._CommonPropertyConstants
+ * and should be synchronized with this copy on shared
+ * 
+ * @author Leonardo Uribe
+ *
+ */
+public class CommonPropertyConstants
+{
+    public static final String COMMON_PROPERTIES_MARKED = "oam.COMMON_PROPERTIES_MARKED";
+    
+    //_StyleProperties
+    public static final long STYLE_PROP       = 0x1L;
+    public static final long STYLECLASS_PROP = 0x2L;
+    
+    //_UniversalProperties
+    //_TitleProperty
+    public static final long DIR_PROP         = 0x4L;
+    public static final long LANG_PROP        = 0x8L;
+    public static final long TITLE_PROP       = 0x10L;
+    
+    //_EscapeProperty
+    public static final long ESCAPE_PROP      = 0x20L;
+
+    //_DisabledClassEnabledClassProperties
+    //_DisabledReadonlyProperties
+    public static final long DISABLED_PROP    = 0x40L;
+    public static final long ENABLED_PROP     = 0x80L;
+    public static final long READONLY_PROP    = 0x100L;
+
+    //_AccesskeyProperty
+    public static final long ACCESSKEY_PROP  = 0x200L;
+    
+    //_AltProperty
+    public static final long ALT_PROP         = 0x400L;
+    
+    //_ChangeSelectProperties
+    public static final long ONCHANGE_PROP    = 0x800L;
+    public static final long ONSELECT_PROP    = 0x1000L;
+    
+    //_EventProperties
+    public static final long ONCLICK_PROP     = 0x2000L;
+    public static final long ONDBLCLICK_PROP  = 0x4000L;
+    public static final long ONMOUSEDOWN_PROP = 0x8000L;
+    public static final long ONMOUSEUP_PROP   = 0x10000L;
+    public static final long ONMOUSEOVER_PROP = 0x20000L;
+    public static final long ONMOUSEMOVE_PROP = 0x40000L;
+    public static final long ONMOUSEOUT_PROP  = 0x80000L;
+    public static final long ONKEYPRESS_PROP  = 0x100000L;
+    public static final long ONKEYDOWN_PROP   = 0x200000L;
+    public static final long ONKEYUP_PROP     = 0x400000L;
+    
+    //_FocusBlurProperties
+    public static final long ONFOCUS_PROP     = 0x800000L;
+    public static final long ONBLUR_PROP      = 0x1000000L;
+
+    //_LabelProperty
+    public static final long LABEL_PROP       = 0x2000000L;
+    
+    //_LinkProperties
+    public static final long CHARSET_PROP     = 0x4000000L;
+    public static final long COORDS_PROP      = 0x8000000L;
+    public static final long HREFLANG_PROP    = 0x10000000L;
+    public static final long REL_PROP         = 0x20000000L;
+    public static final long REV_PROP         = 0x40000000L;
+    public static final long SHAPE_PROP       = 0x80000000L;
+    public static final long TARGET_PROP      = 0x100000000L;
+    public static final long TYPE_PROP        = 0x200000000L;
+
+    //_TabindexProperty
+    public static final long TABINDEX_PROP    = 0x400000000L;
+    
+    //Common to input fields
+    public static final long ALIGN_PROP       = 0x800000000L;
+    public static final long CHECKED_PROP     = 0x1000000000L;
+    public static final long MAXLENGTH_PROP   = 0x2000000000L;
+    public static final long SIZE_PROP        = 0x4000000000L;
+    
+    public static Map<String, Long> COMMON_PROPERTIES_KEY_BY_NAME = new HashMap<String, Long>(64,1);
+    
+    static
+    {
+        COMMON_PROPERTIES_KEY_BY_NAME.put("style",      STYLE_PROP);
+        
+        COMMON_PROPERTIES_KEY_BY_NAME.put("styleClass", STYLECLASS_PROP);
+        
+        //_UniversalProperties
+        //_TitleProperty
+        COMMON_PROPERTIES_KEY_BY_NAME.put("dir",        DIR_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("lang",       LANG_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("title",      TITLE_PROP);
+        
+        //_EscapeProperty
+        COMMON_PROPERTIES_KEY_BY_NAME.put("escape",     ESCAPE_PROP);
+
+        //_DisabledClassEnabledClassProperties
+        //_DisabledReadonlyProperties
+        COMMON_PROPERTIES_KEY_BY_NAME.put("disabled",   DISABLED_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("enabled",    ENABLED_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("readonly",   READONLY_PROP);
+
+        //_AccesskeyProperty
+        COMMON_PROPERTIES_KEY_BY_NAME.put("accesskey",  ACCESSKEY_PROP);
+        
+        //_AltProperty
+        COMMON_PROPERTIES_KEY_BY_NAME.put("alt",        ALT_PROP);
+        
+        //_ChangeSelectProperties
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onchange",   ONCHANGE_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onselect",   ONSELECT_PROP);
+        
+        //_EventProperties
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onclick",    ONCLICK_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("ondblclick", ONDBLCLICK_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onmousedown",ONMOUSEDOWN_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onmouseup",  ONMOUSEUP_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onmouseover",ONMOUSEOVER_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onmousemove",ONMOUSEMOVE_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onmouseout", ONMOUSEOUT_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onkeypress", ONKEYPRESS_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onkeydown",  ONKEYDOWN_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onkeyup",    ONKEYUP_PROP);
+        
+        //_FocusBlurProperties
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onfocus",    ONFOCUS_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("onblur",     ONBLUR_PROP);
+
+        //_LabelProperty
+        COMMON_PROPERTIES_KEY_BY_NAME.put("label",      LABEL_PROP);
+        
+        //_LinkProperties
+        COMMON_PROPERTIES_KEY_BY_NAME.put("charset",    CHARSET_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("coords",     COORDS_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("hreflang",   HREFLANG_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("rel",        REL_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("rev",        REV_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("shape",      SHAPE_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("target",     TARGET_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("type",       TYPE_PROP);
+
+        //_TabindexProperty
+        COMMON_PROPERTIES_KEY_BY_NAME.put("tabindex",   TABINDEX_PROP);
+
+        //Common to input fields
+        COMMON_PROPERTIES_KEY_BY_NAME.put("align",      ALIGN_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("checked",    CHECKED_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("maxlength",  MAXLENGTH_PROP);
+        COMMON_PROPERTIES_KEY_BY_NAME.put("size",       SIZE_PROP);
+    }
+    
+    public static void markProperty(UIComponent component, String name)
+    {
+        Long propertyConstant = COMMON_PROPERTIES_KEY_BY_NAME.get(name);
+        if (propertyConstant == null)
+        {
+            return;
+        }
+        Long commonPropertiesSet = (Long) component.getAttributes().get(COMMON_PROPERTIES_MARKED);
+        if (commonPropertiesSet == null)
+        {
+            commonPropertiesSet = 0L;
+        }
+        component.getAttributes().put(COMMON_PROPERTIES_MARKED, commonPropertiesSet | propertyConstant);
+    }
+    
+    public static void markProperty(UIComponent component, long propertyConstant)
+    {
+        Long commonPropertiesSet = (Long) component.getAttributes().get(COMMON_PROPERTIES_MARKED);
+        if (commonPropertiesSet == null)
+        {
+            commonPropertiesSet = 0L;
+        }
+        component.getAttributes().put(COMMON_PROPERTIES_MARKED, commonPropertiesSet | propertyConstant);
+    }
+}

Added: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java?rev=1160481&view=auto
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java (added)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java Mon Aug 22 22:49:42 2011
@@ -0,0 +1,466 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.shared.renderkit.html;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ResponseWriter;
+
+public final class CommonPropertyUtils
+{
+    public static long getCommonPropertiesMarked(UIComponent component)
+    {
+        Long commonProperties = (Long) component.getAttributes().get(CommonPropertyConstants.COMMON_PROPERTIES_MARKED);
+        
+        if (commonProperties == null)
+        {
+            commonProperties = 0L;
+        }
+
+        return commonProperties;
+    }
+    
+    public static boolean isIdRenderingNecessary(UIComponent component)
+    {
+        return component.getId() != null && !component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX);
+    }
+
+    public static final void renderHTMLStringAttribute(ResponseWriter writer,
+            UIComponent component, String componentProperty, String htmlAttrName)
+            throws IOException
+    {
+        String value = (String) component.getAttributes()
+                .get(componentProperty);
+        writer.writeAttribute(htmlAttrName, value, componentProperty);
+    }
+
+    public static final void renderUniversalProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.DIR_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.DIR_ATTR, HTML.DIR_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.LANG_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.LANG_ATTR, HTML.LANG_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.TITLE_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.TITLE_ATTR, HTML.TITLE_ATTR);
+        }
+    }
+    
+    public static final void renderUniversalPropertiesWithoutTitle(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.DIR_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.DIR_ATTR, HTML.DIR_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.LANG_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.LANG_ATTR, HTML.LANG_ATTR);
+        }
+    }
+
+    public static final void renderStyleProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.STYLE_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.STYLE_ATTR, HTML.STYLE_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.STYLECLASS_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.STYLE_CLASS_ATTR, HTML.CLASS_ATTR);
+        }
+    }
+
+    public static final void renderEventProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONCLICK_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONCLICK_ATTR, HTML.ONCLICK_ATTR);
+        }
+        renderEventPropertiesWithoutOnclick(writer, commonPropertiesMarked, component);
+    }
+    
+    public static final void renderEventPropertiesWithoutOnclick(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONDBLCLICK_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONDBLCLICK_ATTR, HTML.ONDBLCLICK_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEDOWN_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONMOUSEDOWN_ATTR, HTML.ONMOUSEDOWN_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEUP_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONMOUSEUP_ATTR, HTML.ONMOUSEUP_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEOVER_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONMOUSEOVER_ATTR, HTML.ONMOUSEOVER_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEMOVE_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONMOUSEMOVE_ATTR, HTML.ONMOUSEMOVE_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONMOUSEOUT_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONMOUSEOUT_ATTR, HTML.ONMOUSEOUT_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYPRESS_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONKEYPRESS_ATTR, HTML.ONKEYPRESS_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYDOWN_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONKEYDOWN_ATTR, HTML.ONKEYDOWN_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONKEYUP_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONKEYUP_ATTR, HTML.ONKEYUP_ATTR);
+        }
+    }
+    
+    
+    public static final void renderChangeSelectEventProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONCHANGE_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONCHANGE_ATTR, HTML.ONCHANGE_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONSELECT_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONSELECT_ATTR, HTML.ONSELECT_ATTR);
+        }
+    }
+    
+    public static final void renderFocusBlurEventProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONFOCUS_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONFOCUS_ATTR, HTML.ONFOCUS_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ONBLUR_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ONBLUR_ATTR, HTML.ONBLUR_ATTR);
+        }
+    }
+    
+    public static void renderAccesskeyTabindexProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.ACCESSKEY_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ACCESSKEY_ATTR, HTML.ACCESSKEY_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.TABINDEX_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.TABINDEX_ATTR, HTML.TABINDEX_ATTR);
+        }
+    }
+
+    public static void renderAltAlignProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+            throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.ALIGN_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ALIGN_ATTR, HTML.ALIGN_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ALT_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ALT_ATTR, HTML.ALT_ATTR);
+        }
+    }
+
+    public static final void renderInputProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.ALIGN_PROP) != 0)
+        {
+            HtmlRendererUtils.renderHTMLAttribute(writer, component,
+                    HTML.ALIGN_ATTR, HTML.ALIGN_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ALT_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ALT_ATTR, HTML.ALT_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.CHECKED_PROP) != 0)
+        {
+            HtmlRendererUtils.renderHTMLAttribute(writer, component,
+                    HTML.CHECKED_ATTR, HTML.CHECKED_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.MAXLENGTH_PROP) != 0)
+        {
+            HtmlRendererUtils.renderHTMLAttribute(writer, component,
+                    HTML.MAXLENGTH_ATTR, HTML.MAXLENGTH_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.READONLY_PROP) != 0)
+        {
+            HtmlRendererUtils.renderHTMLAttribute(writer, component,
+                    HTML.READONLY_ATTR, HTML.READONLY_ATTR);
+        }
+        if ((commonPropertiesMarked & CommonPropertyConstants.SIZE_PROP) != 0)
+        {
+            HtmlRendererUtils.renderHTMLAttribute(writer, component,
+                    HTML.SIZE_ATTR, HTML.SIZE_ATTR);
+        }        
+    }
+    
+    public static final void renderAnchorProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderAccesskeyTabindexProperties(writer, commonPropertiesMarked, component);
+        if ((commonPropertiesMarked & CommonPropertyConstants.CHARSET_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.CHARSET_ATTR, HTML.CHARSET_ATTR);
+        }        
+        if ((commonPropertiesMarked & CommonPropertyConstants.COORDS_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.COORDS_ATTR, HTML.COORDS_ATTR);
+        }        
+        if ((commonPropertiesMarked & CommonPropertyConstants.HREFLANG_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.HREFLANG_ATTR, HTML.HREFLANG_ATTR);
+        }        
+        if ((commonPropertiesMarked & CommonPropertyConstants.REL_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.REL_ATTR, HTML.REL_ATTR);
+        }        
+        if ((commonPropertiesMarked & CommonPropertyConstants.REV_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.REV_ATTR, HTML.REV_ATTR);
+        }        
+        if ((commonPropertiesMarked & CommonPropertyConstants.SHAPE_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.SHAPE_ATTR, HTML.SHAPE_ATTR);
+        }        
+        if ((commonPropertiesMarked & CommonPropertyConstants.TARGET_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.TARGET_ATTR, HTML.TARGET_ATTR);
+        }        
+        if ((commonPropertiesMarked & CommonPropertyConstants.TYPE_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.TYPE_ATTR, HTML.TYPE_ATTR);
+        }        
+    }
+
+    public static final void renderCommonPassthroughPropertiesWithoutEvents(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component) 
+    throws IOException
+    {
+        renderStyleProperties(writer, commonPropertiesMarked, component);
+        renderUniversalProperties(writer, commonPropertiesMarked, component);
+    }    
+    
+    public static final void renderCommonPassthroughProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component) 
+    throws IOException
+    {
+        renderStyleProperties(writer, commonPropertiesMarked, component);
+        renderUniversalProperties(writer, commonPropertiesMarked, component);
+        renderEventProperties(writer, commonPropertiesMarked, component);
+    }
+
+    //Methods 
+    public static final void renderCommonFieldEventProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component) 
+    throws IOException
+    {
+        renderChangeSelectEventProperties(writer, commonPropertiesMarked, component);
+        renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
+    }
+
+    public static final void renderCommonFieldPassthroughPropertiesWithoutDisabled(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component) 
+    throws IOException
+    {
+        renderCommonPassthroughProperties(writer, commonPropertiesMarked, component);
+        renderAccesskeyTabindexProperties(writer, commonPropertiesMarked, component);
+        renderCommonFieldEventProperties(writer, commonPropertiesMarked, component);
+    }
+    
+    public static final void renderCommonFieldPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component) 
+    throws IOException
+    {
+        renderCommonPassthroughPropertiesWithoutEvents(writer, commonPropertiesMarked, component);
+        renderAccesskeyTabindexProperties(writer, commonPropertiesMarked, component);
+    }
+    
+    public static final void renderInputPassthroughPropertiesWithoutDisabled(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderInputProperties(writer, commonPropertiesMarked, component);
+        renderCommonFieldPassthroughPropertiesWithoutDisabled(writer, commonPropertiesMarked, component);
+    }
+    
+    public static final void renderInputPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderInputProperties(writer, commonPropertiesMarked, component);
+        renderCommonFieldPassthroughPropertiesWithoutDisabledAndEvents(writer, commonPropertiesMarked, component);
+    }
+
+    public static final void renderAnchorPassthroughProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderAnchorProperties(writer, commonPropertiesMarked, component);
+        renderCommonPassthroughProperties(writer, commonPropertiesMarked, component);
+        renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
+    }
+    
+    public static final void renderAnchorPassthroughPropertiesWithoutEvents(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderAnchorProperties(writer, commonPropertiesMarked, component);
+        renderStyleProperties(writer, commonPropertiesMarked, component);
+        renderUniversalProperties(writer, commonPropertiesMarked, component);
+    }
+    
+    public static final void renderAnchorPassthroughPropertiesWithoutStyleAndEvents(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderAnchorProperties(writer, commonPropertiesMarked, component);
+        renderUniversalProperties(writer, commonPropertiesMarked, component);
+    }
+    
+    public static final void renderAnchorPassthroughPropertiesWithoutStyle(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderAnchorProperties(writer, commonPropertiesMarked, component);
+        renderUniversalProperties(writer, commonPropertiesMarked, component);
+        renderEventProperties(writer, commonPropertiesMarked, component);
+        renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
+    }
+    
+    public static final void renderAnchorPassthroughPropertiesWithoutOnclickAndStyle(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderAnchorProperties(writer, commonPropertiesMarked, component);
+        renderUniversalProperties(writer, commonPropertiesMarked, component);
+        renderEventPropertiesWithoutOnclick(writer, commonPropertiesMarked, component);
+        renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
+    }
+
+    public static final void renderButtonPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component)
+    throws IOException
+    {
+        renderUniversalProperties(writer, commonPropertiesMarked, component);
+        renderStyleProperties(writer, commonPropertiesMarked, component);
+        renderAccesskeyTabindexProperties(writer, commonPropertiesMarked, component);
+        renderAltAlignProperties(writer, commonPropertiesMarked, component);
+    }
+
+    public static final void renderLabelProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component) 
+    throws IOException
+    {
+        renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
+        if ((commonPropertiesMarked & CommonPropertyConstants.ACCESSKEY_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ACCESSKEY_ATTR, HTML.ACCESSKEY_ATTR);
+        }
+    }
+
+    
+    public static final void renderLabelPassthroughProperties(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component) 
+    throws IOException
+    {
+        renderLabelProperties(writer, commonPropertiesMarked, component);
+        renderCommonPassthroughProperties(writer, commonPropertiesMarked, component);
+    }
+
+    public static final void renderLabelPassthroughPropertiesWithoutEvents(ResponseWriter writer,
+            long commonPropertiesMarked, UIComponent component) 
+    throws IOException
+    {
+        if ((commonPropertiesMarked & CommonPropertyConstants.ACCESSKEY_PROP) != 0)
+        {
+            renderHTMLStringAttribute(writer, component,
+                    HTML.ACCESSKEY_ATTR, HTML.ACCESSKEY_ATTR);
+        }
+        renderCommonPassthroughPropertiesWithoutEvents(writer, commonPropertiesMarked, component);
+    }
+}

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java Mon Aug 22 22:49:42 2011
@@ -84,16 +84,35 @@ public class HtmlBodyRendererBase extend
                     ClientBehaviorEvents.LOAD, behaviors, HTML.ONLOAD_ATTR);
             HtmlRendererUtils.renderBehaviorizedAttribute(facesContext, writer, HTML.ONUNLOAD_ATTR, component,
                     ClientBehaviorEvents.UNLOAD, behaviors, HTML.ONUNLOAD_ATTR);
-            HtmlRendererUtils.renderHTMLAttributes(writer, component,
-                    HTML.BODY_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
-            
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component,
+                        HTML.BODY_ATTRIBUTES);
+                CommonPropertyUtils.renderCommonPassthroughPropertiesWithoutEvents(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component,
+                        HTML.BODY_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            }
         }
         else
         {
             writer.startElement(HTML.BODY_ELEM, component);
             HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
-            HtmlRendererUtils.renderHTMLAttributes(writer, component,
-                    HTML.BODY_PASSTHROUGH_ATTRIBUTES);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component,
+                        HTML.BODY_ATTRIBUTES);
+                CommonPropertyUtils.renderCommonPassthroughProperties(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component,
+                        HTML.BODY_PASSTHROUGH_ATTRIBUTES);
+            }
         }
     }
 

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java Mon Aug 22 22:49:42 2011
@@ -72,12 +72,12 @@ public class HtmlButtonRendererBase
             uiComponent.queueEvent(new ActionEvent(uiComponent));
 
             org.apache.myfaces.shared.renderkit.RendererUtils.initPartialValidationAndModelUpdate(uiComponent, facesContext);
-            
-            if (uiComponent instanceof ClientBehaviorHolder &&
-                    !HtmlRendererUtils.isDisabled(uiComponent))
-            {
-                HtmlRendererUtils.decodeClientBehaviors(facesContext, uiComponent);
-            }
+        }
+        
+        if (uiComponent instanceof ClientBehaviorHolder &&
+                !HtmlRendererUtils.isDisabled(uiComponent))
+        {
+            HtmlRendererUtils.decodeClientBehaviors(facesContext, uiComponent);
         }
     }
 
@@ -141,7 +141,9 @@ public class HtmlButtonRendererBase
         List<UIParameter> validParams = HtmlRendererUtils.getValidUIParameterChildren(
                 facesContext, getChildren(uiComponent), false, false);
         
-        if (formInfo != null && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext())
+        boolean javascriptAllowed = JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext());
+        
+        if (formInfo != null && javascriptAllowed
                 && (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll() ||
                         (validParams != null && !validParams.isEmpty() )))
         {        
@@ -184,7 +186,7 @@ public class HtmlButtonRendererBase
             }
         }
         
-        if (JavascriptUtils.isJavascriptAllowed(externalContext) &&
+        if (javascriptAllowed &&
             (HtmlRendererUtils.hasClientBehavior(ClientBehaviorEvents.CLICK, behaviors, facesContext) ||
              HtmlRendererUtils.hasClientBehavior(ClientBehaviorEvents.ACTION, behaviors, facesContext)))
         {
@@ -215,11 +217,8 @@ public class HtmlButtonRendererBase
             HtmlRendererUtils.buildBehaviorChain(
                     facesContext, uiComponent, ClientBehaviorEvents.DBLCLICK, null, behaviors,   
                         (String) attributes.get(HTML.ONDBLCLICK_ATTR), "");
-            
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
-                                                   HTML.BUTTON_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);            
         }
-        else if (JavascriptUtils.isJavascriptAllowed(externalContext))
+        else if (javascriptAllowed)
         {
             //fallback into the pre 2.0 code to keep backwards compatibility with libraries which rely on internals
             if (!reset && !button)
@@ -234,14 +233,22 @@ public class HtmlButtonRendererBase
             {
                 HtmlRendererUtils.renderHTMLAttribute(writer, uiComponent, HTML.ONCLICK_ATTR, HTML.ONCLICK_ATTR);
             }
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
-                                                   HTML.BUTTON_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
         }
-        else
+        
+        if (javascriptAllowed)
         {
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
-                                                   HTML.BUTTON_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderButtonPassthroughPropertiesWithoutDisabledAndEvents(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+                                                       HTML.BUTTON_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            }
         }
+
         
         if (behaviors != null && !behaviors.isEmpty())
         {
@@ -250,10 +257,19 @@ public class HtmlButtonRendererBase
         }
         else
         {
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
-                    HTML.EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK);
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
-                    HTML.COMMON_FIELD_EVENT_ATTRIBUTES);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                long commonPropertiesMarked = CommonPropertyUtils.getCommonPropertiesMarked(uiComponent);
+                CommonPropertyUtils.renderEventPropertiesWithoutOnclick(writer, commonPropertiesMarked, uiComponent);
+                CommonPropertyUtils.renderCommonFieldEventProperties(writer, commonPropertiesMarked, uiComponent);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+                        HTML.EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK);
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+                        HTML.COMMON_FIELD_EVENT_ATTRIBUTES);
+            }
         }
 
         if (isDisabled(facesContext, uiComponent))

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java Mon Aug 22 22:49:42 2011
@@ -97,11 +97,29 @@ public class HtmlFormRendererBase
         {
             behaviors = ((ClientBehaviorHolder) htmlForm).getClientBehaviors();
             HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, htmlForm, behaviors);
-            HtmlRendererUtils.renderHTMLAttributes(writer, htmlForm, HTML.FORM_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderCommonPassthroughPropertiesWithoutEvents(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+                HtmlRendererUtils.renderHTMLAttributes(writer, htmlForm, HTML.FORM_ATTRIBUTES);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, htmlForm, HTML.FORM_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            }
         }
         else
         {
-            HtmlRendererUtils.renderHTMLAttributes(writer, htmlForm, HTML.FORM_PASSTHROUGH_ATTRIBUTES);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderCommonPassthroughProperties(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+                HtmlRendererUtils.renderHTMLAttributes(writer, htmlForm, HTML.FORM_ATTRIBUTES);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, htmlForm, HTML.FORM_PASSTHROUGH_ATTRIBUTES);
+            }
         }
 
         writer.write(""); // force start element tag to be closed

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java Mon Aug 22 22:49:42 2011
@@ -132,12 +132,30 @@ public class HtmlGridRendererBase
                 HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
             }
             HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, component, behaviors);
-            HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.TABLE_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.TABLE_ATTRIBUTES);
+                CommonPropertyUtils.renderCommonPassthroughPropertiesWithoutEvents(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.TABLE_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            }
         }
         else
         {
             HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
-            HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.TABLE_ATTRIBUTES);
+                CommonPropertyUtils.renderCommonPassthroughProperties(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
+            }
         }
 
         writer.flush();

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGroupRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGroupRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGroupRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGroupRendererBase.java Mon Aug 22 22:49:42 2011
@@ -79,14 +79,37 @@ public class HtmlGroupRendererBase
 
             HtmlRendererUtils.writeIdIfNecessary(writer, component, context);
 
-            HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+            if (isCommonPropertiesOptimizationEnabled(context))
+            {
+                CommonPropertyUtils.renderCommonPassthroughProperties(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+            }
         }
         else
         {
-            span=HtmlRendererUtils.renderHTMLAttributesWithOptionalStartElement(writer,
-                                                                             component,
-                                                                             layoutElement,
-                                                                             HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+            if (isCommonPropertiesOptimizationEnabled(context))
+            {
+                long commonPropertiesMarked = CommonPropertyUtils.getCommonPropertiesMarked(component);
+                if (commonPropertiesMarked > 0)
+                {
+                    span = true;
+                    writer.startElement(layoutElement, component);
+                    HtmlRendererUtils.writeIdIfNecessary(writer, component, context);
+
+                    CommonPropertyUtils.renderCommonPassthroughProperties(writer, commonPropertiesMarked, component);
+                }
+            }
+            else
+            {
+                span=HtmlRendererUtils.renderHTMLAttributesWithOptionalStartElement(writer,
+                                                                                 component,
+                                                                                 layoutElement,
+                                                                                 HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+            }
         }
 
         RendererUtils.renderChildren(context, component);

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java Mon Aug 22 22:49:42 2011
@@ -25,13 +25,10 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.faces.application.ProjectStage;
-import javax.faces.application.Resource;
-import javax.faces.application.ResourceHandler;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIGraphic;
 import javax.faces.component.behavior.ClientBehavior;
 import javax.faces.component.behavior.ClientBehaviorHolder;
-import javax.faces.component.html.HtmlGraphicImage;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
 
@@ -98,7 +95,8 @@ public class HtmlImageRendererBase
         }
         else
         {
-          if (log.isLoggable(Level.WARNING)) log.warning("Graphic with id " + uiComponent.getClientId(facesContext) + " has no value (url or name).");
+          if (facesContext.isProjectStage(ProjectStage.Development) && log.isLoggable(Level.WARNING)) 
+              log.warning("Component UIGraphic " + uiComponent.getClientId(facesContext) + " has no attribute url, value, name or attribute resolves to null. Path to component " + RendererUtils.getPathToComponent(uiComponent));
         }
 
         /* 
@@ -106,20 +104,36 @@ public class HtmlImageRendererBase
          */                
         if (uiComponent.getAttributes().get(HTML.ALT_ATTR) == null) 
         {
-            //we don't want to flood logs with warnings in production and system test environments
-            ProjectStage projectStage = facesContext.getApplication().getProjectStage();
-            if(projectStage.equals(ProjectStage.Development) || projectStage.equals(ProjectStage.UnitTest))
-                log.warning("ALT attribute is missing for : " + uiComponent.getId());
+            if(!facesContext.isProjectStage(ProjectStage.Development) && log.isLoggable(Level.WARNING))
+                log.warning("Component UIGraphic " + uiComponent.getClientId(facesContext) + " has no attribute alt or attribute resolves to null. Path to component " + RendererUtils.getPathToComponent(uiComponent));
         }
 
         if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
         {
             HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, uiComponent, behaviors);
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.IMG_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.IMG_ATTRIBUTES);
+                CommonPropertyUtils.renderCommonPassthroughPropertiesWithoutEvents(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.IMG_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            }
         }
         else
         {
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.IMG_PASSTHROUGH_ATTRIBUTES);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.IMG_ATTRIBUTES);
+                CommonPropertyUtils.renderCommonPassthroughProperties(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.IMG_PASSTHROUGH_ATTRIBUTES);
+            }
         }
 
         writer.endElement(org.apache.myfaces.shared.renderkit.html.HTML.IMG_ELEM);

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java Mon Aug 22 22:49:42 2011
@@ -243,17 +243,33 @@ public abstract class HtmlLinkRendererBa
                 }
                 HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, component, behaviors);
                 HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, component, behaviors);
-                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                }
             }
             else
             {
                 HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
-                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughProperties(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                }
             }
         }
         else
         {
-            String[] anchorAttrsToRender;
+            //String[] anchorAttrsToRender;
             if (JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
             {
                 if (component instanceof ClientBehaviorHolder)
@@ -270,24 +286,48 @@ public abstract class HtmlLinkRendererBa
                     }
                     HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(facesContext, writer, component, behaviors);
                     HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, component, behaviors);
-                    anchorAttrsToRender = HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE_AND_EVENTS;
+                    if (isCommonPropertiesOptimizationEnabled(facesContext))
+                    {
+                        CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutStyleAndEvents(writer, 
+                                CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+                    }
+                    else
+                    {
+                        HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE_AND_EVENTS);
+                    }
                 }
                 else
                 {
                     renderJavaScriptAnchorStart(facesContext, writer, component, clientId, formInfo);
                     HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
-                    anchorAttrsToRender = HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE;
+                    if (isCommonPropertiesOptimizationEnabled(facesContext))
+                    {
+                        CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutOnclickAndStyle(writer, 
+                                CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+                    }
+                    else
+                    {
+                        HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE);
+                    }
                 }
             }
             else
             {
                 renderNonJavaScriptAnchorStart(facesContext, writer, component, clientId, formInfo);
                 HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
-                anchorAttrsToRender = HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE;
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutStyle(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE);
+                }
             }
 
-            HtmlRendererUtils.renderHTMLAttributes(writer, component,
-                                                   anchorAttrsToRender);
+            //HtmlRendererUtils.renderHTMLAttributes(writer, component,
+            //                                       anchorAttrsToRender);
             HtmlRendererUtils.renderHTMLAttribute(writer, HTML.STYLE_ATTR, HTML.STYLE_ATTR,
                                                   style);
             HtmlRendererUtils.renderHTMLAttribute(writer, HTML.STYLE_CLASS_ATTR, HTML.STYLE_CLASS_ATTR,
@@ -711,12 +751,28 @@ public abstract class HtmlLinkRendererBa
                 }
                 HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, output, behaviors);
                 HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, output, behaviors);
-                HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(output), output);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                }
             }
             else
             {
                 HtmlRendererUtils.writeIdIfNecessary(writer, output, facesContext);
-                HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughProperties(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(output), output);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                }
             }
         }
         else
@@ -778,12 +834,28 @@ public abstract class HtmlLinkRendererBa
                 }
                 HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, output, behaviors);
                 HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, output, behaviors);
-                HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(output), output);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                }
             }
             else
             {
                 HtmlRendererUtils.writeIdAndNameIfNecessary(writer, output, facesContext);
-                HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughProperties(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(output), output);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                }
             }
             writer.flush();
         }
@@ -815,12 +887,28 @@ public abstract class HtmlLinkRendererBa
                 }
                 HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, output, behaviors);
                 HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, output, behaviors);
-                HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(output), output);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                }
             }
             else
             {
                 HtmlRendererUtils.writeIdIfNecessary(writer, output, facesContext);
-                HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughProperties(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(output), output);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                }
             }
 
             Object value = output.getValue();
@@ -848,12 +936,28 @@ public abstract class HtmlLinkRendererBa
                 }
                 HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, output, behaviors);
                 HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, output, behaviors);
-                HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(output), output);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+                }
             }
             else
             {
                 HtmlRendererUtils.writeIdAndNameIfNecessary(writer, output, facesContext);
-                HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                if (isCommonPropertiesOptimizationEnabled(facesContext))
+                {
+                    CommonPropertyUtils.renderAnchorPassthroughProperties(writer, 
+                            CommonPropertyUtils.getCommonPropertiesMarked(output), output);
+                }
+                else
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+                }
             }
 
             writer.flush();

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java Mon Aug 22 22:49:42 2011
@@ -132,26 +132,62 @@ public class HtmlOutcomeTargetButtonRend
             }
         }
 
-        if (uiComponent instanceof ClientBehaviorHolder
-                && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+        if (isCommonPropertiesOptimizationEnabled(facesContext))
         {
-            HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
-                    facesContext, writer, uiComponent, behaviors);
-            HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
-                    facesContext, writer, uiComponent, behaviors);
+            long commonPropertiesMarked = CommonPropertyUtils.getCommonPropertiesMarked(uiComponent);
+            
+            if (JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+            {
+                if (behaviors != null && !behaviors.isEmpty() && uiComponent instanceof ClientBehaviorHolder)
+                {
+                    HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
+                            facesContext, writer, uiComponent, behaviors);
+                    HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+                            facesContext, writer, uiComponent, behaviors);
+                }
+                else
+                {
+                    CommonPropertyUtils.renderEventPropertiesWithoutOnclick(writer, commonPropertiesMarked, uiComponent);
+                    CommonPropertyUtils.renderFocusBlurEventProperties(writer, commonPropertiesMarked, uiComponent);
+                }
+            }
+            else
+            {
+                CommonPropertyUtils.renderEventPropertiesWithoutOnclick(writer, commonPropertiesMarked, uiComponent);
+                CommonPropertyUtils.renderFocusBlurEventProperties(writer, commonPropertiesMarked, uiComponent);
+            }
+            
+            CommonPropertyUtils.renderCommonFieldPassthroughPropertiesWithoutDisabledAndEvents(
+                    writer, commonPropertiesMarked, uiComponent);
+            if ((commonPropertiesMarked & CommonPropertyConstants.ALT_PROP) != 0)
+            {
+                CommonPropertyUtils.renderHTMLStringAttribute(writer, uiComponent,
+                        HTML.ALT_ATTR, HTML.ALT_ATTR);
+            }
         }
         else
         {
+            if (uiComponent instanceof ClientBehaviorHolder
+                    && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+            {
+                HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
+                        facesContext, writer, uiComponent, behaviors);
+                HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+                        facesContext, writer, uiComponent, behaviors);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+                        HTML.EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK);
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
+                        HTML.COMMON_FIELD_EVENT_ATTRIBUTES_WITHOUT_ONSELECT_AND_ONCHANGE);
+    
+            }
             HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
-                    HTML.EVENT_HANDLER_ATTRIBUTES_WITHOUT_ONCLICK);
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
-                    HTML.COMMON_FIELD_EVENT_ATTRIBUTES_WITHOUT_ONSELECT_AND_ONCHANGE);
-
+                    HTML.COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            HtmlRendererUtils.renderHTMLAttribute(writer, uiComponent,
+                    HTML.ALT_ATTR, HTML.ALT_ATTR);
         }
-        HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent,
-                HTML.COMMON_FIELD_PASSTROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
-        HtmlRendererUtils.renderHTMLAttribute(writer, uiComponent,
-                HTML.ALT_ATTR, HTML.ALT_ATTR);
 
         writer.flush();
     }

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java Mon Aug 22 22:49:42 2011
@@ -149,4 +149,9 @@ public abstract class HtmlRenderer
 
       return uri;
     }
+    
+    protected boolean isCommonPropertiesOptimizationEnabled(FacesContext facesContext)
+    {
+        return false;
+    }
 }

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java Mon Aug 22 22:49:42 2011
@@ -1751,15 +1751,20 @@ public final class HtmlRendererUtils {
         if (sourceId == null || !sourceId.equals(clientId)) {
             return false;
         }
+        boolean partialOrBehaviorSubmit = false;
         String behaviorEvent = params.get("javax.faces.behavior.event");
         if (behaviorEvent != null) {
-            return ClientBehaviorEvents.ACTION.equals(behaviorEvent);
+            partialOrBehaviorSubmit = ClientBehaviorEvents.ACTION.equals(behaviorEvent);
+            if (partialOrBehaviorSubmit)
+            {
+                return partialOrBehaviorSubmit;
+            }
         }
         String partialEvent = params.get("javax.faces.partial.event");
         if (partialEvent != null) {
-            return ClientBehaviorEvents.CLICK.equals(partialEvent);
+            partialOrBehaviorSubmit = ClientBehaviorEvents.CLICK.equals(partialEvent);
         }
-        return false;
+        return partialOrBehaviorSubmit;
     }
 
     /**
@@ -2406,7 +2411,8 @@ public final class HtmlRendererUtils {
                                                                 List<UIComponent> children, boolean skipNullValue, boolean skipUnrendered, boolean skipNullName) {
         List<UIParameter> params = null;
 
-        for (UIComponent child : children) {
+        for (int i = 0, size = children.size(); i < size; i++) {
+            UIComponent child = children.get(i);
             if (child instanceof UIParameter) {
                 UIParameter param = (UIParameter) child;
 

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java Mon Aug 22 22:49:42 2011
@@ -118,11 +118,27 @@ public class HtmlSecretRendererBase
             HtmlRendererUtils.renderBehaviorizedOnchangeEventHandler(facesContext, writer, uiComponent, behaviors);
             HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, uiComponent, behaviors);
             HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(facesContext, writer, uiComponent, behaviors);
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderInputPassthroughPropertiesWithoutDisabledAndEvents(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            }
         }
         else
         {
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderInputPassthroughPropertiesWithoutDisabled(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+            }
         }
 
         if (isDisabled(facesContext, uiComponent))

Modified: myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java?rev=1160481&r1=1160480&r2=1160481&view=diff
==============================================================================
--- myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java (original)
+++ myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java Mon Aug 22 22:49:42 2011
@@ -150,12 +150,30 @@ public class HtmlTableRendererBase exten
                 HtmlRendererUtils.writeIdIfNecessary(writer, uiComponent, facesContext);
             }
             HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, uiComponent, behaviors);
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TABLE_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TABLE_ATTRIBUTES);
+                CommonPropertyUtils.renderCommonPassthroughPropertiesWithoutEvents(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TABLE_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+            }
         }
         else
         {
             HtmlRendererUtils.writeIdIfNecessary(writer, uiComponent, facesContext);
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TABLE_ATTRIBUTES);
+                CommonPropertyUtils.renderCommonPassthroughProperties(writer, 
+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
+            }
         }
     }