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 2016/02/23 05:11:54 UTC
svn commit: r1731784 - in
/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html:
CommonPropertyUtils.java HTML.java HtmlLinkRendererBase.java
Author: lu4242
Date: Tue Feb 23 04:11:54 2016
New Revision: 1731784
URL: http://svn.apache.org/viewvc?rev=1731784&view=rev
Log:
MYFACES-3926 Disabled h:outputLink renders invalid attributes (now when h:outputLink, h:link or h:commandLink and disabled is enabled, the following attributes are not renderer: charset, coords, hreflang, rel, rev, shape, target, type )
Modified:
myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java
myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HTML.java
myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java?rev=1731784&r1=1731783&r2=1731784&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java (original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java Tue Feb 23 04:11:54 2016
@@ -441,6 +441,15 @@ public final class CommonPropertyUtils
renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
}
+ public static void renderAnchorPassthroughPropertiesDisabled(ResponseWriter writer,
+ long commonPropertiesMarked, UIComponent component)
+ throws IOException
+ {
+ renderAccesskeyTabindexProperties(writer, commonPropertiesMarked, component);
+ renderCommonPassthroughProperties(writer, commonPropertiesMarked, component);
+ renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
+ }
+
public static void renderAnchorPassthroughPropertiesWithoutEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
@@ -450,6 +459,15 @@ public final class CommonPropertyUtils
renderUniversalProperties(writer, commonPropertiesMarked, component);
}
+ public static void renderAnchorPassthroughPropertiesDisabledWithoutEvents(ResponseWriter writer,
+ long commonPropertiesMarked, UIComponent component)
+ throws IOException
+ {
+ renderAccesskeyTabindexProperties(writer, commonPropertiesMarked, component);
+ renderStyleProperties(writer, commonPropertiesMarked, component);
+ renderUniversalProperties(writer, commonPropertiesMarked, component);
+ }
+
public static void renderAnchorPassthroughPropertiesWithoutStyleAndEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HTML.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HTML.java?rev=1731784&r1=1731783&r2=1731784&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HTML.java (original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HTML.java Tue Feb 23 04:11:54 2016
@@ -251,7 +251,22 @@ public interface HTML
(String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(
ANCHOR_ATTRIBUTES,
UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE);
-
+
+ String[] ANCHOR_ATTRIBUTES_DISABLED =
+ {
+ ACCESSKEY_ATTR,
+ TABINDEX_ATTR,
+ };
+ String[] ANCHOR_PASSTHROUGH_ATTRIBUTES_DISABLED =
+ (String[]) ArrayUtils.concat(
+ ANCHOR_ATTRIBUTES_DISABLED,
+ COMMON_PASSTROUGH_ATTRIBUTES,
+ COMMON_FIELD_EVENT_ATTRIBUTES_WITHOUT_ONSELECT_AND_ONCHANGE);
+ String[] ANCHOR_PASSTHROUGH_ATTRIBUTES_DISABLED_WITHOUT_EVENTS =
+ (String[]) ArrayUtils.concat(
+ ANCHOR_ATTRIBUTES_DISABLED,
+ UNIVERSAL_ATTRIBUTES);
+
// <form>
String ACCEPT_CHARSET_ATTR = "accept-charset";
String ENCTYPE_ATTR = "enctype";
Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java?rev=1731784&r1=1731783&r2=1731784&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java (original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java Tue Feb 23 04:11:54 2016
@@ -312,13 +312,13 @@ public abstract class HtmlLinkRendererBa
}
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
- CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer,
+ CommonPropertyUtils.renderAnchorPassthroughPropertiesDisabledWithoutEvents(writer,
commonPropertiesMarked, component);
}
else
{
HtmlRendererUtils.renderHTMLAttributes(writer, component,
- HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_DISABLED_WITHOUT_EVENTS);
}
}
else
@@ -326,12 +326,13 @@ public abstract class HtmlLinkRendererBa
HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
- CommonPropertyUtils.renderAnchorPassthroughProperties(writer,
+ CommonPropertyUtils.renderAnchorPassthroughPropertiesDisabled(writer,
CommonPropertyUtils.getCommonPropertiesMarked(component), component);
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+ HtmlRendererUtils.renderHTMLAttributes(writer, component,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_DISABLED);
}
}
}
@@ -858,13 +859,13 @@ public abstract class HtmlLinkRendererBa
}
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
- CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer,
+ CommonPropertyUtils.renderAnchorPassthroughPropertiesDisabledWithoutEvents(writer,
commonPropertiesMarked, output);
}
else
{
HtmlRendererUtils.renderHTMLAttributes(writer, output,
- HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_DISABLED_WITHOUT_EVENTS);
}
}
else
@@ -872,12 +873,12 @@ public abstract class HtmlLinkRendererBa
HtmlRendererUtils.writeIdIfNecessary(writer, output, facesContext);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
- CommonPropertyUtils.renderAnchorPassthroughProperties(writer,
+ CommonPropertyUtils.renderAnchorPassthroughPropertiesDisabled(writer,
CommonPropertyUtils.getCommonPropertiesMarked(output), output);
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+ HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_DISABLED);
}
}
}
@@ -1053,13 +1054,13 @@ public abstract class HtmlLinkRendererBa
}
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
- CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer,
+ CommonPropertyUtils.renderAnchorPassthroughPropertiesDisabledWithoutEvents(writer,
commonPropertiesMarked, output);
}
else
{
HtmlRendererUtils.renderHTMLAttributes(writer, output,
- HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_DISABLED_WITHOUT_EVENTS);
}
}
else
@@ -1067,12 +1068,12 @@ public abstract class HtmlLinkRendererBa
HtmlRendererUtils.writeIdIfNecessary(writer, output, facesContext);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
- CommonPropertyUtils.renderAnchorPassthroughProperties(writer,
+ CommonPropertyUtils.renderAnchorPassthroughPropertiesDisabled(writer,
CommonPropertyUtils.getCommonPropertiesMarked(output), output);
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+ HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_DISABLED);
}
}