myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1152968 [2/2] - in /myfaces/core/branches/2.0.x: api/src/main/java/javax/faces/component/html/ api/src/main/resources/META-INF/ impl/src/main/java/org/apache/myfaces/renderkit/html/ impl/src/test/java/org/apache/myfaces/renderkit/html/ sha...
Date Mon, 01 Aug 2011 23:25:01 GMT
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java?rev=1152968&r1=1152967&r2=1152968&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
Mon Aug  1 23:24:53 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;
 
@@ -115,11 +112,29 @@ public class HtmlImageRendererBase
         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/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java?rev=1152968&r1=1152967&r2=1152968&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
Mon Aug  1 23:24:53 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/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java?rev=1152968&r1=1152967&r2=1152968&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
Mon Aug  1 23:24:53 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/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java?rev=1152968&r1=1152967&r2=1152968&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRenderer.java
Mon Aug  1 23:24:53 2011
@@ -149,4 +149,9 @@ public abstract class HtmlRenderer
 
       return uri;
     }
+    
+    protected boolean isCommonPropertiesOptimizationEnabled(FacesContext facesContext)
+    {
+        return false;
+    }
 }

Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java?rev=1152968&r1=1152967&r2=1152968&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java
Mon Aug  1 23:24:53 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/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java?rev=1152968&r1=1152967&r2=1152968&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
Mon Aug  1 23:24:53 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);
+            }
         }
     }
 

Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java?rev=1152968&r1=1152967&r2=1152968&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
Mon Aug  1 23:24:53 2011
@@ -101,36 +101,54 @@ public class HtmlTextRendererBase
             escape = RendererUtils.getBooleanAttribute(component, org.apache.myfaces.shared.renderkit.JSFAttr.ESCAPE_ATTR,
                                                        true); //default is to escape
         }
-        renderOutputText(facesContext, component, text, escape);
-    }
-
-
-    public static void renderOutputText(FacesContext facesContext,
-                                        UIComponent component,
-                                        String text,
-                                        boolean escape)
-        throws IOException
-    {
         if (text != null)
         {
             ResponseWriter writer = facesContext.getResponseWriter();
             boolean span = false;
 
-            if(component.getId()!=null && !component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
             {
-                span = true;
-
-                writer.startElement(HTML.SPAN_ELEM, component);
-
-                HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
-
-                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.COMMON_PASSTROUGH_ATTRIBUTES);
-
+                long commonPropertiesMarked = CommonPropertyUtils.getCommonPropertiesMarked(component);
+                
+                if (commonPropertiesMarked > 0)
+                {
+                    span = true;
+                    writer.startElement(HTML.SPAN_ELEM, component);
+                    HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
+                }
+                else if (CommonPropertyUtils.isIdRenderingNecessary(component))
+                {
+                    span = true;
+                    writer.startElement(HTML.SPAN_ELEM, component);
+                    writer.writeAttribute(HTML.ID_ATTR, component.getClientId(facesContext),
null);
+                }
+                
+                CommonPropertyUtils.renderUniversalProperties(writer, commonPropertiesMarked,
component);
+                CommonPropertyUtils.renderStyleProperties(writer, commonPropertiesMarked,
component);
+                
+                if (isRenderOutputEventAttributes())
+                {
+                    HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.EVENT_HANDLER_ATTRIBUTES);
+                }
             }
             else
             {
-                span = HtmlRendererUtils.renderHTMLAttributesWithOptionalStartElement(writer,component,
-                        HTML.SPAN_ELEM,HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+                if(component.getId()!=null && !component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
+                {
+                    span = true;
+    
+                    writer.startElement(HTML.SPAN_ELEM, component);
+    
+                    HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
+    
+                    HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+    
+                }
+                else
+                {
+                    span = HtmlRendererUtils.renderHTMLAttributesWithOptionalStartElement(writer,component,
+                            HTML.SPAN_ELEM,HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+                }
             }
 
             if (escape)
@@ -150,6 +168,10 @@ public class HtmlTextRendererBase
         }
     }
 
+    protected boolean isRenderOutputEventAttributes()
+    {
+        return true;
+    }
 
     protected void renderInput(FacesContext facesContext, UIComponent component)
         throws IOException
@@ -189,11 +211,27 @@ public class HtmlTextRendererBase
             HtmlRendererUtils.renderBehaviorizedOnchangeEventHandler(facesContext, writer,
component, behaviors);
             HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, component,
behaviors);
             HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(facesContext,
writer, component, behaviors);
-            HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderInputPassthroughPropertiesWithoutDisabledAndEvents(writer,

+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            }
         }
         else
         {
-            HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderInputPassthroughPropertiesWithoutDisabled(writer,

+                        CommonPropertyUtils.getCommonPropertiesMarked(component), component);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.INPUT_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+            }
         }
 
         if (isDisabled(facesContext, component))
@@ -284,5 +322,55 @@ public class HtmlTextRendererBase
         //subclasses may act on properties of the component
         return HTML.INPUT_TYPE_TEXT;
     }
-    
+
+    public static void renderOutputText(FacesContext facesContext,
+            UIComponent component, String text, boolean escape)
+            throws IOException
+    {
+        if (text != null)
+        {
+            ResponseWriter writer = facesContext.getResponseWriter();
+            boolean span = false;
+
+            if (component.getId() != null
+                    && !component.getId().startsWith(
+                            UIViewRoot.UNIQUE_ID_PREFIX))
+            {
+                span = true;
+
+                writer.startElement(HTML.SPAN_ELEM, component);
+
+                HtmlRendererUtils.writeIdIfNecessary(writer, component,
+                        facesContext);
+
+                HtmlRendererUtils.renderHTMLAttributes(writer, component,
+                        HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+
+            }
+            else
+            {
+                span = HtmlRendererUtils
+                        .renderHTMLAttributesWithOptionalStartElement(writer,
+                                component, HTML.SPAN_ELEM,
+                                HTML.COMMON_PASSTROUGH_ATTRIBUTES);
+            }
+
+            if (escape)
+            {
+                if (log.isLoggable(Level.FINE))
+                    log.fine("renderOutputText writing '" + text + "'");
+                writer.writeText(text,
+                        org.apache.myfaces.shared.renderkit.JSFAttr.VALUE_ATTR);
+            }
+            else
+            {
+                writer.write(text);
+            }
+
+            if (span)
+            {
+                writer.endElement(org.apache.myfaces.shared.renderkit.html.HTML.SPAN_ELEM);
+            }
+        }
+    }
 }

Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java?rev=1152968&r1=1152967&r2=1152968&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java
(original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java
Mon Aug  1 23:24:53 2011
@@ -98,13 +98,31 @@ public class HtmlTextareaRendererBase
             HtmlRendererUtils.renderBehaviorizedOnchangeEventHandler(facesContext, writer,
uiComponent, behaviors);
             HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, uiComponent,
behaviors);
             HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchange(facesContext,
writer, uiComponent, behaviors);
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderCommonFieldPassthroughPropertiesWithoutDisabledAndEvents(writer,

+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TEXTAREA_ATTRIBUTES);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED_AND_EVENTS);
+            }
         }
         else
         {
             HtmlRendererUtils.writeIdIfNecessary(writer, uiComponent, facesContext);
             writer.writeAttribute(HTML.NAME_ATTR, uiComponent.getClientId(facesContext),
null);
-            HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+            if (isCommonPropertiesOptimizationEnabled(facesContext))
+            {
+                CommonPropertyUtils.renderCommonFieldPassthroughPropertiesWithoutDisabled(writer,

+                        CommonPropertyUtils.getCommonPropertiesMarked(uiComponent), uiComponent);
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TEXTAREA_ATTRIBUTES);
+            }
+            else
+            {
+                HtmlRendererUtils.renderHTMLAttributes(writer, uiComponent, HTML.TEXTAREA_PASSTHROUGH_ATTRIBUTES_WITHOUT_DISABLED);
+            }
         }
 
         if (isDisabled(facesContext, uiComponent))



Mime
View raw message