myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1520182 - in /myfaces/core/trunk: impl/src/test/java/org/apache/myfaces/renderkit/html/ impl/src/test/java/org/apache/myfaces/test/utils/ impl/src/test/resources/org/apache/myfaces/renderkit/ impl/src/test/resources/org/apache/myfaces/rend...
Date Thu, 05 Sep 2013 00:42:00 GMT
Author: lu4242
Date: Thu Sep  5 00:42:00 2013
New Revision: 1520182

URL: http://svn.apache.org/r1520182
Log:
MYFACES-3717 Implement "role" attribute in related components and renderers

Added:
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRolePassedThroughTestCase.java
  (with props)
    myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/renderkit/
    myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/renderkit/html/
    myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/renderkit/html/role.xhtml
  (with props)
Modified:
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlButtonRendererTest.java
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormatRendererTest.java
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLabelRendererTest.java
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessageRendererTest.java
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/test/utils/HtmlCheckAttributesUtil.java
    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/HtmlMessageRendererBase.java

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlButtonRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlButtonRendererTest.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlButtonRendererTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlButtonRendererTest.java
Thu Sep  5 00:42:00 2013
@@ -91,6 +91,7 @@ public class HtmlButtonRendererTest exte
             new HtmlRenderedAttr("dir"), 
             new HtmlRenderedAttr("lang"), 
             new HtmlRenderedAttr("title"),
+            new HtmlRenderedAttr("role"),
 
             /* If js is set to false, no need to bother over event attributes
             //_FocusBlurProperties
@@ -141,6 +142,7 @@ public class HtmlButtonRendererTest exte
                new HtmlRenderedAttr("dir"), 
                new HtmlRenderedAttr("lang"), 
                new HtmlRenderedAttr("title"),
+               new HtmlRenderedAttr("role"),
                //_FocusBlurProperties
                new HtmlRenderedAttr("onfocus"), 
                new HtmlRenderedAttr("onblur"),

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlCheckboxRendererTest.java
Thu Sep  5 00:42:00 2013
@@ -93,6 +93,7 @@ public class HtmlCheckboxRendererTest ex
             new HtmlRenderedAttr("dir"), 
             new HtmlRenderedAttr("lang"), 
             new HtmlRenderedAttr("title"),
+            new HtmlRenderedAttr("role"),
             //_FocusBlurProperties
             new HtmlRenderedAttr("onfocus"), 
             new HtmlRenderedAttr("onblur"),

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormatRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormatRendererTest.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormatRendererTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlFormatRendererTest.java
Thu Sep  5 00:42:00 2013
@@ -72,6 +72,7 @@ public class HtmlFormatRendererTest exte
                 new HtmlRenderedAttr("dir"), 
                 new HtmlRenderedAttr("lang"), 
                 new HtmlRenderedAttr("title"),
+                new HtmlRenderedAttr("role"),
                 //_StyleProperties
                 new HtmlRenderedAttr("style"), 
                 new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLabelRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLabelRendererTest.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLabelRendererTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLabelRendererTest.java
Thu Sep  5 00:42:00 2013
@@ -76,6 +76,7 @@ public class HtmlLabelRendererTest exten
             new HtmlRenderedAttr("dir"), 
             new HtmlRenderedAttr("lang"), 
             new HtmlRenderedAttr("title"),
+            new HtmlRenderedAttr("role"),
             //_FocusBlurProperties
             new HtmlRenderedAttr("onfocus"), 
             new HtmlRenderedAttr("onblur"),

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessageRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessageRendererTest.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessageRendererTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessageRendererTest.java
Thu Sep  5 00:42:00 2013
@@ -102,6 +102,7 @@ public class HtmlMessageRendererTest ext
             new HtmlRenderedAttr("dir"), 
             new HtmlRenderedAttr("lang"), 
             new HtmlRenderedAttr("title"),
+            new HtmlRenderedAttr("role"),
             //_EventProperties
             new HtmlRenderedAttr("onclick"), 
             new HtmlRenderedAttr("ondblclick"), 

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlMessagesRendererTest.java
Thu Sep  5 00:42:00 2013
@@ -95,6 +95,7 @@ public class HtmlMessagesRendererTest ex
             //_StyleProperties
             new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
             new HtmlRenderedAttr("style"),
+            new HtmlRenderedAttr("role"),
             new HtmlRenderedAttr("warnClass", "warnClass", "class=\"warnClass\"",2),
             new HtmlRenderedAttr("warnStyle", "warnStyle", "style=\"warnStyle\"",2)
         };

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRadioRendererTest.java
Thu Sep  5 00:42:00 2013
@@ -89,6 +89,7 @@ public class HtmlRadioRendererTest exten
             new HtmlRenderedAttr("dir"), 
             new HtmlRenderedAttr("lang"), 
             new HtmlRenderedAttr("title"),
+            new HtmlRenderedAttr("role"),
             //_FocusBlurProperties
             new HtmlRenderedAttr("onfocus"), 
             new HtmlRenderedAttr("onblur"),

Added: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRolePassedThroughTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRolePassedThroughTestCase.java?rev=1520182&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRolePassedThroughTestCase.java
(added)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRolePassedThroughTestCase.java
Thu Sep  5 00:42:00 2013
@@ -0,0 +1,90 @@
+/*
+ * 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.renderkit.html;
+
+import java.io.StringWriter;
+
+import javax.el.ExpressionFactory;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIViewRoot;
+
+import junit.framework.Assert;
+
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.view.facelets.ELExpressionCacheMode;
+import org.apache.myfaces.view.facelets.FaceletTestCase;
+import org.apache.myfaces.view.facelets.impl.FaceletCompositionContextImpl;
+import org.junit.Test;
+
+public class HtmlRolePassedThroughTestCase extends FaceletTestCase
+{
+
+    @Override
+    protected void setUpServletObjects() throws Exception
+    {
+        super.setUpServletObjects();
+    }
+
+    @Override
+    protected ExpressionFactory createExpressionFactory()
+    {
+        return new org.apache.el.ExpressionFactoryImpl();
+    }
+
+    @Test
+    public void testRole() throws Exception
+    {
+        UIViewRoot root = facesContext.getViewRoot();
+        vdl.buildView(facesContext, root, "role.xhtml");
+
+        StringWriter sw = new StringWriter();
+        MockResponseWriter mrw = new MockResponseWriter(sw);
+        facesContext.setResponseWriter(mrw);
+
+        root.encodeAll(facesContext);
+        sw.flush();
+        //System.out.println("********************HTMLRolePassedThroughTest*****************");
+        //System.out.println(sw.toString());
+        //System.out.println("********************HTMLRolePassedThroughTest*****************");
+        Assert.assertTrue(sw.toString().contains("value=\"user name\" role=\"new presentation\""));
+        Assert.assertTrue(sw.toString().contains("id=\"helloForm:link\" role=\"new presentation\""));
+        Assert.assertTrue(sw.toString().contains("<table role=\"new presentation\">"));
+        Assert.assertTrue(sw.toString().contains("value=\"one\" role=\"new presentation\""));
+
+        Assert.assertTrue(sw.toString().contains("id=\"helloForm:data\" role=\"new presentation\""));
+        Assert.assertTrue(sw.toString().contains("id=\"helloForm:graphic\" role=\"new presentation\""));
+        Assert.assertTrue(sw.toString().contains("type=\"file\" role=\"new presentation\""));
+        Assert.assertTrue(sw.toString().contains("name=\"helloForm:area\" role=\"new presentation\""));
+
+        Assert.assertTrue(sw.toString().contains("id=\"helloForm:outputFormat\" role=\"new
presentation\""));
+        Assert.assertTrue(sw.toString().contains("id=\"helloForm:outputLabel\" role=\"new
presentation\""));
+        Assert.assertTrue(sw.toString().contains("name=\"helloForm:outputLink\" role=\"new
presentation\""));
+        Assert.assertTrue(sw.toString().contains("id=\"helloForm:outputText\" role=\"new
presentation\""));
+
+        // Assert.assertTrue(sw.toString().contains("(?s).*<h:selectBooleanCheckbox\\s+role=\"new
presentation\".*"));
+        // Assert.assertTrue(sw.toString().contains("(?s).*<h:selectManyCheckbox\\s+role=\"new
presentation\".*"));
+        Assert.assertTrue(sw.toString().contains("name=\"helloForm:selectManyListbox\" multiple=\"multiple\"
size=\"0\" role=\"new presentation\""));
+        Assert.assertTrue(sw.toString().contains("name=\"helloForm:selectManyMenu\" multiple=\"multiple\"
size=\"1\" role=\"new presentation\""));
+
+        Assert.assertTrue(sw.toString().contains("name=\"helloForm:selectOneListbox\" size=\"0\"
role=\"new presentation\""));
+        Assert.assertTrue(sw.toString().contains("name=\"helloForm:selectOneMenu\" size=\"1\"
role=\"new presentation\""));
+        // Assert.assertTrue(sw.toString().contains("(?s).*<h:selectOneRadio\\s+role=\"new
presentation\".*"));
+
+    }
+}

Propchange: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlRolePassedThroughTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/test/utils/HtmlCheckAttributesUtil.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/test/utils/HtmlCheckAttributesUtil.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/test/utils/HtmlCheckAttributesUtil.java
(original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/test/utils/HtmlCheckAttributesUtil.java
Thu Sep  5 00:42:00 2013
@@ -176,6 +176,7 @@ public class HtmlCheckAttributesUtil 
             new HtmlRenderedAttr("dir"), 
             new HtmlRenderedAttr("lang"), 
             new HtmlRenderedAttr("title"),
+            new HtmlRenderedAttr("role"),
             //_FocusBlurProperties
             new HtmlRenderedAttr("onfocus"), 
             new HtmlRenderedAttr("onblur"),
@@ -226,6 +227,7 @@ public class HtmlCheckAttributesUtil 
             new HtmlRenderedAttr("dir"), 
             new HtmlRenderedAttr("lang"), 
             new HtmlRenderedAttr("title"),
+            new HtmlRenderedAttr("role"),
             //_EventProperties
             new HtmlRenderedAttr("onclick"), 
             new HtmlRenderedAttr("ondblclick"), 

Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/renderkit/html/role.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/renderkit/html/role.xhtml?rev=1520182&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/renderkit/html/role.xhtml
(added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/renderkit/html/role.xhtml
Thu Sep  5 00:42:00 2013
@@ -0,0 +1,52 @@
+<!--
+ * 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.
+ *
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:ui="http://java.sun.com/jsf/facelets"
+      xmlns:h="http://java.sun.com/jsf/html">
+    <body>
+        <h:form role="new presentation" id="helloForm" >
+            <h:inputText type="text" id="userNo" value="1" />
+            <h:inputText role="new presentation" type="text" id="userName" value="user
name" />
+            <br/>
+            <h:commandLink role="new presentation" id ="link"  />   
+            <h:panelGrid role="new presentation" columns="2" > 
+                <h:commandButton role="new presentation" id="one" value="one"  /> 
+                <h:dataTable role="new presentation" id="data"  />   
+                <h:graphicImage role="new presentation"  id="graphic"  />
+                <h:inputFile role="new presentation"  id="file"  />
+                <h:inputTextarea role="new presentation"  id="area"  />	  
+                <h:outputFormat role="new presentation" id="outputFormat"  />
+                <h:outputLabel role="new presentation" id="outputLabel"  />
+                <h:outputLink role="new presentation"  id="outputLink"  />
+                <h:outputText role="new presentation"  id="outputText"  />
+                <h:selectBooleanCheckbox role="new presentation"  id="selectBooleanCheckbox"
 />
+                <h:selectManyCheckbox role="new presentation" id="selectManyCheckbox"
 />
+                <h:selectManyListbox role="new presentation"  id="selectManyListbox" 
/>
+                <h:selectManyMenu role="new presentation" id="selectManyMenu"  />
+                <h:selectOneListbox role="new presentation" id="selectOneListbox"  />
+                <h:selectOneMenu role="new presentation" id="selectOneMenu"  />
+                <h:selectOneRadio role="new presentation"  id="selectOneRadio"  />
+            </h:panelGrid> 
+            <h:commandButton type="submit" id="submit" action="success" value="Submit"
/>
+            <br/>
+        </h:form>
+    </body>
+</html>

Propchange: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/renderkit/html/role.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

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=1520182&r1=1520181&r2=1520182&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
Thu Sep  5 00:42:00 2013
@@ -62,6 +62,11 @@ public final class CommonPropertyUtils
             HtmlRendererUtils.renderHTMLStringAttribute(writer, component,
                     HTML.TITLE_ATTR, HTML.TITLE_ATTR);
         }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ROLE_PROP) != 0)
+        {
+            HtmlRendererUtils.renderHTMLStringAttribute(writer, component,
+                    HTML.ROLE_ATTR, HTML.ROLE_ATTR);
+        }
     }
     
     public static final void renderUniversalPropertiesWithoutTitle(ResponseWriter writer,
@@ -78,6 +83,11 @@ public final class CommonPropertyUtils
             HtmlRendererUtils.renderHTMLStringAttribute(writer, component,
                     HTML.LANG_ATTR, HTML.LANG_ATTR);
         }
+        if ((commonPropertiesMarked & CommonPropertyConstants.ROLE_PROP) != 0)
+        {
+            HtmlRendererUtils.renderHTMLStringAttribute(writer, component,
+                    HTML.ROLE_ATTR, HTML.ROLE_ATTR);
+        }
     }
 
     public static final void renderStyleProperties(ResponseWriter writer,

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=1520182&r1=1520181&r2=1520182&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
Thu Sep  5 00:42:00 2013
@@ -113,19 +113,22 @@ public interface HTML
     String STYLE_ATTR = "style";
     String TITLE_ATTR = "title";
     String STYLE_CLASS_ATTR = "styleClass"; //"class" cannot be used as property name
-     
+    // Role attribute (applies for "every" html tag)
+    String ROLE_ATTR  = "role"; 
+    
     String[] UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE =
     {
         DIR_ATTR,
         LANG_ATTR,
         TITLE_ATTR,
-
+        ROLE_ATTR,
         //NOTE: if changed, please verify universal attributes in HtmlMessageRenderer !
     };
     String[] UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE_AND_TITLE =
     {
         DIR_ATTR,
         LANG_ATTR,
+        ROLE_ATTR,
     };
     String[] UNIVERSAL_ATTRIBUTES =
             (String[]) org.apache.myfaces.shared.util.ArrayUtils.concat(

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java?rev=1520182&r1=1520181&r2=1520182&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java
Thu Sep  5 00:42:00 2013
@@ -305,6 +305,12 @@ public abstract class HtmlMessageRendere
                     writer, message, HTML.SPAN_ELEM, HTML.STYLE_ATTR, style, span);
             span |= HtmlRendererUtils.renderHTMLAttributeWithOptionalStartElement(
                     writer, message, HTML.SPAN_ELEM, HTML.STYLE_CLASS_ATTR, styleClass, span);
+            // Remember if renderStyleAndStyleClass is true, it means style and styleClass
+            // are rendered on the outer tag, and in that sense, role attribute should
+            // be rendered there too.
+            span |= HtmlRendererUtils.renderHTMLAttributeWithOptionalStartElement(
+                    writer, message, HTML.ROLE_ATTR, HTML.ROLE_ATTR, 
+                    message.getAttributes().get(HTML.ROLE_ATTR), span);
         }
 
         if (showSummary && !(title == null && tooltip))



Mime
View raw message