You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2017/09/17 12:30:23 UTC

[myfaces-trinidad] branch 1.2.12.2-branch created (now 1d2e43d)

This is an automated email from the ASF dual-hosted git repository.

deki pushed a change to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git.


      at 1d2e43d  Trinidad-1795 Fix regression that caused CSS file's hash to change between server restarts by using stable hash codes for the enums.

This branch includes the following new commits:

     new be698c0  fix bug where the css file was missing most of the selectors from the .xss skinning files. The reason was that the AgentAtRuleMatcher was being checked, even for StyleSheetNode's that did not have browsers specified. Therefore only the StyleSheetNodes with browsers specified and that matched the user's browser were being included in the css.
     new 99b3c68  TRINIDAD-1041 Support locale-specific styles submitted patch for Marius Petoi This also includes removes duplicate @agent in purpleSkin.css adds a text explaining locale skin in panelPageSkinDemo.jspx fixed error in old @agent doc in skinning.xml 1.2.12.2-branch
     new ff38a29  code cleanup removed synchronization since it is not needed in StyleSheetNodeParser.java In StyleSheetNodeParser, refactored the _init methods to be similar to the _initBrowsers method which was refactored in an earlier checkin by Blake Sullivan. removed unused imports from StyleSheetNode.java
     new 193c48d  code cleanup commented skinning code SkinStyleSheetParserUtils.java - static public StyleSheetEntry parseCSSSource (returns StyleSheetEntry instead of Object) StyleSheetNode - use contains on Set before looping of locale matching
     new 585232b  TRINIDAD-1687 add a Skin api that will clear the skin file(s) and reload at runtime The api is   /**    * Check to see if this Skin has been marked dirty.    * The only way to mark a Skin dirty is to call setDirty(true).    * @return true if the Skin is marked dirty.    */   abstract public boolean isDirty();
     new 6e06ca9  Implement JIRA-1668 by storing the id attribute on the UIXComponentBase itself and modifying the UIXFacesBeanImpl to delegate back to the UIXComponentBase for id access through the AttributeMap.  I also cleaned up the way that ids and clientIds are generated so that getId() will never return a null id. In order to make the UIXComponentBase change backwards compatible, I moved the UIXFacesBeanImpl and UIXEditableFacesBeanImpl classes to api where our customers can take ad [...]
     new 9d9fd39  TRINIDAD-1692 remove newlines in css file if in compressed mode This is in CSSGenerationUtils
     new c96ad4c  TRINIDAD-1678 TrNumberFormat.prototype.numberToString doesn't account for numbers represented via scientific notation commit for Cale Scholl
     new a5ff7f8  TRINIDAD-1690
     new f680255  add a FINE and a FINEST log message to SkinStyleProvider and FileSystemStyleCache. This can be turned on to monitor when we create a new SkinStyleProvider object and when we create a FileSystemStyleCache Key.
     new 06ec7bf  TRINIDAD-1699
     new 024abf7  TRINIDAD-1696 acc (screen reader mode) layout tables should include role="presentation"
     new 648e795  TRINIDAD-1702 performance: decrease memory of FileSystemStyleCache by reusing CSSStyle objects.
     new 5ec6839  Make sure that the ID_KEY is present in the UIXFacesBeanImpl.java key set when the UIXFacesBeanImpl is delegating the storageof the ID property back to the UIXComponentBase.
     new 23b5c07  TRINIDAD-1676 - ha: provide facility to support putting uicompoenent references into the session
     new 821819f  The first problem we have had is that components need to separate the context setup and teardown needed to process their children from the context setup and tear down of the components themselves.  For example, consider a composite component that establishes an EL context for its children--that context should only be setup when the children are being processed, not when the component is processing its own attributes.
     new 4d686bc  TRINIDAD-1714 Mark the skin as dirty if DesignTime mode and org.apache.myfaces.trinidad.skin.id is set. This is reverting the change I made for TRINIDAD-1637 always check for file modification if in DesignTime mode regardless of web.xml setting This essentially does the same thing, but it doesn't check the file for modification. It always recomputes the Skin and its css file.
     new c12f150  clean up
     new 29b53ea  TRINIDAD-1613 - Add support for rowKey change
     new 5601f68  TRINIDAD-1683 client-side convertNumber causes loss of precision
     new 1c84421  TRINIDAD-1728 - Trinidad not supporting Opera Mobile in HTC
     new fcc5b78  TRINIDAD-1738 - prevent infinite recursion by keeping a set of visited components, ensuring that each component is only visited once during a partialUpdateNotify call
     new c7a2ca1  Handle case the the VisitContext.ALL_IDS is returned from the VisitContext, since it doesn't support getSize().
     new e9a5acc  TRINIDAD-1669 Improve transient memory consumption of UIXComponentBase.getClientId()
     new 42b48e3  The default for clientId caching was accidentally true.  Argh!! Fix case where the component is moved between NamingContainers and therefore needs to clear the cached clientIds
     new 433da04  Fix setId() to clear the cached clientId at the end of the function so that the code that checks whether we have a cached clientId works correctly Add tests for the basic cases where a cached clientId needs to be cleared--setting the id of a NamingContainer (clear subtree), setting the id of a component (clear component's cached clientId), move component between NamingContainers (clear subtree)
     new 995fe9b  Fixes for TRINIDAD-1740 Replace Trinidad TreeVisiting APIs with JSF 2 TreeVisiting APIs TRINIDAD-1669 Improve transient memory consumption of UIXComponentBase.getClientId()
     new 6056352  TRINIDAD-1739 ComponentReference doesn't work with bindings and should be more thread-safe
     new 7422113  porting to revision 920595 to this branch:
     new a4d1cbe  TRINIDAD-1746 move InputStreamProvider to be a public API also move NameResolver to be public.
     new 048678a  TRINIDAD-1746 move InputStreamProvider to be a public API also move NameResolver to be public. forgot to add the new files in the previous checkin!
     new 889825a  TRINIDAD-1729 provide a hook for for an external decorator of Skin InputStreamProvider NameResolver - changed the doc a little bit StyleSheetEntry - figure out which InputStreamProvider to use (FileInputStreamProvider, URLInputStreamProvider, etc) based on the filename, then create the StyleSheetNameResolver. If an InputStreamProvider cannot be created with these methods, then we look at META-INF/services/org.apache.myfaces.trinidad.share.io.NameResolver for a custom Nam [...]
     new 69fb48a  TRINIDAD-1747 zip page state to reduce live memory
     new a455df4  TRINIDAD-1757 - Allow (or support) decorator pattern for the UploadedFileProcessor
     new a6ac9d2  java5 issue with TRINIDAD-1757
     new 1d2e43d  Trinidad-1795 Fix regression that caused CSS file's hash to change between server restarts by using stable hash codes for the enums.

The 36 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@myfaces.apache.org" <co...@myfaces.apache.org>'].

[myfaces-trinidad] 20/36: TRINIDAD-1683 client-side convertNumber causes loss of precision

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 5601f68d8aca2186ebcd69bd7132f5928a332926
Author: Gabrielle Crawford <gc...@apache.org>
AuthorDate: Tue Feb 23 18:55:21 2010 +0000

    TRINIDAD-1683 client-side convertNumber causes loss of precision
---
 .../trinidadinternal/convert/NumberConverter.java  | 41 ++++++++++++++++++++++
 .../trinidadinternal/resource/LoggerBundle.xrts    |  3 ++
 2 files changed, 44 insertions(+)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java
index 71df002..23cb8cc 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/NumberConverter.java
@@ -25,6 +25,8 @@ import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.el.ValueExpression;
+
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.ConverterException;
@@ -193,6 +195,45 @@ public class NumberConverter extends org.apache.myfaces.trinidad.convert.NumberC
       UIComponent  component,
       Map<?, ?>    messages)
     {
+      Object value = component.getAttributes().get("value");
+      if (value == null)
+      {
+        ValueExpression expression = component.getValueExpression("value");
+        if (expression != null)
+        {
+          value = expression.getValue(context.getELContext());
+        
+          // If value is bound to an Object that is initially null, then we must devise another way 
+          // to determine the type of the Object we are bound to, as there's no way for null to be 
+          // interpreted as any type other than Object; thus, we determine the type then instantiate 
+          // an Object of that type, initializing it to an arbitrarily chosen value. 
+          // Specifically, it is assumed that value is bound to a numeric type that provides a one 
+          // argument constructor that takes a String, so we instantiate an object of that type with 
+          // an arbitrarily chosen value of "0".
+          if (value == null)
+          {
+            try
+            {
+              value = expression.getType(context.getELContext()).getConstructor(String.class).newInstance("0");
+            }
+            catch (Exception e)
+            {
+              _LOG.warning(e.getLocalizedMessage());
+            }
+          }
+        }
+      }
+      
+      // Only render a client converter if the input value is bound to a supported type 
+      // (Float, Double, Integer, Short, Byte). The JavaScript number is a 64-bit floating type and 
+      // has enough precision to represent any of these supported types.
+      if (!(value instanceof Float || value instanceof Double || value instanceof Integer 
+            || value instanceof Short || value instanceof Byte))
+      {
+        _LOG.warning("UNSUPPORTED_NUMBERCONVERTER_TYPE");
+        return null;
+      }
+      
       StringBuilder outBuffer = new StringBuilder(250);
       outBuffer.append("new TrNumberConverter(");
 
diff --git a/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts b/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
index f8e7a71..cb51498 100644
--- a/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
+++ b/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
@@ -1042,6 +1042,9 @@ The skin {0} specified on the requestMap will be used even though the consumer''
 
  <!-- FILEDOWNLOADACTIONLISTENERS_METHOD_MUST_BE_EL_EXPRESSION -->
  <resource key="FILEDOWNLOADACTIONLISTENERS_METHOD_MUST_BE_EL_EXPRESSION">fileDownloadActionListener's 'method' attribute must be an EL expression.</resource>
+ 
+ <!-- UNSUPPORTED_NUMBERCONVERTER_TYPE -->
+ <resource key="UNSUPPORTED_NUMBERCONVERTER_TYPE">Only a server-side NumberConverter will be available; a client-side NumberConverter is provided only if the input value is bound to one of the following supported types: Float Double Integer Short Byte</resource>
 
 <!-- STATUS_INDICATOR_MISSING_ICONS -->
 <resource key="STATUS_INDICATOR_MISSING_ICONS">The statusIndicator component requires both a 'ready' and 'busy' icon;  one is missing.</resource>

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 23/36: Handle case the the VisitContext.ALL_IDS is returned from the VisitContext, since it doesn't support getSize().

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit c7a2ca1e87d486a98e5fdc82657ff790a43b0a27
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Thu Feb 25 18:42:12 2010 +0000

    Handle case the the VisitContext.ALL_IDS is returned from the VisitContext, since it doesn't support getSize().
---
 .../trinidad/component/UIXIteratorTemplate.java    | 122 +++++++++++++--------
 1 file changed, 76 insertions(+), 46 deletions(-)

diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXIteratorTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXIteratorTemplate.java
index 85bafad..20a5f28 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXIteratorTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXIteratorTemplate.java
@@ -260,73 +260,103 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
   {
     Collection<String> subtreeIds = visitContext.getSubtreeIdsToVisit(this);
  
-    String ourClientIdPrefix = getClientId(visitContext.getFacesContext());
-   
-    int subtreeIdCount = subtreeIds.size();
-    
-    // build up a set of the row keys to visit rather than iterating
-    // and visiting every row
-    Set<String> rowsToVisit;
+    // create a special VisitContext that doesn't visit the Facets
+    // of column components since they aren't visited on each row
+    final VisitContext noColumnFacetContext = new NoColumnFacetsVisitContext(visitContext);
+
+    // runner to use to process the rows
+    Runner runner;
     
-    if (subtreeIdCount > 1)
+    if (VisitContext.ALL_IDS.equals(subtreeIds))
     {
-      rowsToVisit = new HashSet<String>(subtreeIdCount);
-
-      for (String currClientId : subtreeIds)
+      // we're processing all of the rows, so use the indexed runner (plus, we can't call size() on
+      // the ALL_IDS collection, so we don't have a whole lot of choice here
+      runner = new IndexedRunner()
       {
-        String clientToken = _getClientToken(ourClientIdPrefix, currClientId);
-        
-        if (clientToken != null)
+        @Override
+        protected void process(UIComponent kid, ComponentProcessingContext cpContext)
         {
-          rowsToVisit.add(clientToken);          
+          if (kid.getChildCount() > 0)
+          {
+            for (UIComponent grandKid : kid.getChildren())
+            {
+              if (UIXComponent.visitTree(noColumnFacetContext, grandKid, visitCallback))
+              {
+                throw new AbortProcessingException();
+              }
+            }
+          }
         }
-      }
+      };
     }
     else
     {
-      String clientToken = _getClientToken(ourClientIdPrefix,
-                                           subtreeIds.iterator().next());
+      // We are only visiting a subset of the tree, so figure out which rows to visit
+      
+      String ourClientIdPrefix = getClientId(visitContext.getFacesContext());
+     
+      int subtreeIdCount = subtreeIds.size();
+      
+      // build up a set of the row keys to visit rather than iterating
+      // and visiting every row
+      Set<String> rowsToVisit;
       
-      if (clientToken != null)
+      if (subtreeIdCount > 1)
       {
-        rowsToVisit = Collections.singleton(clientToken);
+        rowsToVisit = new HashSet<String>(subtreeIdCount);
+  
+        for (String currClientId : subtreeIds)
+        {
+          String clientToken = _getClientToken(ourClientIdPrefix, currClientId);
+          
+          if (clientToken != null)
+          {
+            rowsToVisit.add(clientToken);          
+          }
+        }
       }
       else
       {
-        rowsToVisit = Collections.emptySet();
+        String clientToken = _getClientToken(ourClientIdPrefix,
+                                             subtreeIds.iterator().next());
+        
+        if (clientToken != null)
+        {
+          rowsToVisit = Collections.singleton(clientToken);
+        }
+        else
+        {
+          rowsToVisit = Collections.emptySet();
+        }
       }
-    }
-    
-    // we didn't visit any data
-    if (rowsToVisit.isEmpty())
-      return false;
-    
-    // create a special VisitContext that doesn't visit the Facets
-    // of column components since they aren't visited on each row
-    final VisitContext noColumnFacetContext = new NoColumnFacetsVisitContext(visitContext);
-    
-    // visit only the rows
-    Runner runner = new KeyedRunner(rowsToVisit)
-    {
-      @Override
-      protected void process(
-        UIComponent                kid,
-        ComponentProcessingContext cpContext
-        ) throws IOException
+      
+      // we didn't visit any data
+      if (rowsToVisit.isEmpty())
+        return false;
+
+      // visit only the rows we need to
+      runner = new KeyedRunner(rowsToVisit)
       {
-        if (kid.getChildCount() > 0)
+        @Override
+        protected void process(
+          UIComponent                kid,
+          ComponentProcessingContext cpContext
+          ) throws IOException
         {
-          for (UIComponent grandKid : kid.getChildren())
+          if (kid.getChildCount() > 0)
           {
-            if (UIXComponent.visitTree(noColumnFacetContext, grandKid, visitCallback))
+            for (UIComponent grandKid : kid.getChildren())
             {
-              throw new AbortProcessingException();
+              if (UIXComponent.visitTree(noColumnFacetContext, grandKid, visitCallback))
+              {
+                throw new AbortProcessingException();
+              }
             }
           }
         }
-      }
-    };
-
+      };
+    }
+        
     try
     {
       runner.run();

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 11/36: TRINIDAD-1699

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 06ec7bf7b02a140eab0b79df45443aaf595bf8a9
Author: Andrew Robinson <ar...@apache.org>
AuthorDate: Wed Jan 27 23:00:36 2010 +0000

    TRINIDAD-1699
    
    Add isSecure method to ExternalContextUtils
---
 .../trinidad/util/ExternalContextUtils.java        | 124 ++++++++++++---------
 1 file changed, 72 insertions(+), 52 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ExternalContextUtils.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ExternalContextUtils.java
index e2437e1..30e77fd 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ExternalContextUtils.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ExternalContextUtils.java
@@ -31,22 +31,23 @@ import javax.servlet.http.HttpServletRequest;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
+
 /**
- * This provides some functionality for determining some things about the 
+ * This provides some functionality for determining some things about the
  * native request object that is not provided by the base utils.
  *
  * @version 2.0
  */
 public final class ExternalContextUtils
 {
-  
+
   /**
    * Returns <code>true</code> if a particular class relating to the supplied
-   * request type is available on the current classpath or <code>false</code> 
+   * request type is available on the current classpath or <code>false</code>
    * if it is not.  This class assumes that all containers have a servlet type
-   * request available, but the portlet request types are all dependant on the 
+   * request available, but the portlet request types are all dependant on the
    * portlet container being used.
-   * 
+   *
    * @param type the RequestType to test
    * @return a boolean value of <code>true</code> if the container contains the
    *         request type in the classpath
@@ -58,15 +59,15 @@ public final class ExternalContextUtils
     {
       case SERVLET:
         return true;
-        
+
       case ACTION:
       case RENDER:
         return _PORTLET_CONTEXT_CLASS != null;
-      
+
       case RESOURCE:
       case EVENT:
         return _PORTLET_RENDER_REQUEST_CLASS != null;
-        
+
       default:
         return false;
     }
@@ -75,13 +76,13 @@ public final class ExternalContextUtils
   /**
    * Returns <code>true</code> if a particular request type is supported by the
    * container.  For a request type to be supported, the required objects must
-   * be on the classpath AND and, in the case of Portlet RequestTypes, an 
+   * be on the classpath AND and, in the case of Portlet RequestTypes, an
    * appropriate bridge must be avaialble which supports those objects.  This
-   * means that if the supplied RequestType is RESOURCE, the 
+   * means that if the supplied RequestType is RESOURCE, the
    * javax.portlet.ResourceRequest object must be available on the classpath AND
    * a bridge which supports the Portlet 2.0 specification would also need to be
    * available.
-   * 
+   *
    * @param type the RequestType to test
    * @return a boolean value of <code>true</code> if the container supports the
    *         current request type
@@ -93,23 +94,23 @@ public final class ExternalContextUtils
     {
       case SERVLET:
         return true;
-        
+
       case ACTION:
       case RENDER:
         return _PORTLET_10_SUPPORTED;
-      
+
       case RESOURCE:
       case EVENT:
         return _PORTLET_20_SUPPORTED;
-        
+
       default:
         return false;
     }
   }
-  
+
   /**
    * Returns the requestType of this ExternalContext.
-   * 
+   *
    * @param ec the current external context
    * @return the appropriate RequestType for this external context
    * @see RequestType
@@ -155,12 +156,12 @@ public final class ExternalContextUtils
 
     return RequestType.SERVLET;
   }
-  
+
   /**
    * Returns the current active session id or <code>null</code> if there is
    * none.  If a session is not already created, this method will create one
    * for you.
-   * 
+   *
    * @param ec the current external context
    * @return a string containing the requestedSessionId
    */
@@ -172,14 +173,14 @@ public final class ExternalContextUtils
   /**
    * Returns the current active session id or <code>null</code> if there is
    * none.
-   * 
+   *
    * @param ec the current external context
    * @param create create a new session if one is not created
    * @return a string containing the requestedSessionId
    */
   public static String getSessionId(ExternalContext ec, boolean create)
   {
-    Object session = ec.getSession(create);   
+    Object session = ec.getSession(create);
     return (null!=session)?(String)_runMethod(session, "getId"):null;
   }
 
@@ -205,7 +206,7 @@ public final class ExternalContextUtils
   {
     return (Boolean) _runMethod(ec.getRequest(), "isRequestedSessionIdValid");
   }
-  
+
   /**
    * Returns the contextPath of the ServletContext or <code>null</code> for portlets
    *
@@ -230,14 +231,14 @@ public final class ExternalContextUtils
    * @param ec the current external context
    * @return a String containing the request context path
    * @see ExternalContext#getRequestContextPath()
-   * 
+   *
    * @deprecated use ExternalContext.getRequestContextPath() as of JSF 1.2.  This method
    *             does not appropriately handle portlet environments, but the functionality
    *             is maintained to prevent needing to change the contract.
    */
   @Deprecated
   public static String getRequestContextPath(ExternalContext ec)
-  { 
+  {
     if(!isPortlet(ec))
     {
       return ec.getRequestContextPath();
@@ -249,14 +250,14 @@ public final class ExternalContextUtils
   }
 
   /**
-   * Returns the requestURI of the HttpServletRequest or <code>null</code> for 
+   * Returns the requestURI of the HttpServletRequest or <code>null</code> for
    * portlet requests
    *
    * @param ec the current external context
    * @return A string containing the current request uri
    */
   public static String getRequestURI(ExternalContext ec)
-  { 
+  {
     if (!isPortlet(ec))
     {
       return ((HttpServletRequest) ec.getRequest()).getRequestURI();
@@ -273,7 +274,7 @@ public final class ExternalContextUtils
    * @param ec the current external context
    * @return a string containing the request's character encoding
    * @see ExternalContext#getRequestCharacterEncoding()
-   * 
+   *
    * @deprecated replaced by an API in JSF.  Use ExternalContext.getRequestCharacterEncoding()
    */
   @Deprecated
@@ -281,11 +282,11 @@ public final class ExternalContextUtils
   {
     return ec.getRequestCharacterEncoding();
   }
-  
+
   /**
    * Returns the name of the underlying context or <code>null</code> if something
    * went wrong in trying to retrieve the context.
-   * 
+   *
    * @param ec the current external context
    * @return a String containing the context name
    */
@@ -350,7 +351,7 @@ public final class ExternalContextUtils
    */
   public static InputStream getRequestInputStream(ExternalContext ec)
       throws IOException
-  { 
+  {
     RequestType type = getRequestType(ec);
     if(type.isRequestFromClient())
     {
@@ -364,20 +365,20 @@ public final class ExternalContextUtils
         return ((ServletRequest) ec.getRequest()).getInputStream();
       }
     }
-    
+
     return null;
   }
 
   /**
-   * Returns <code>true</code> if this externalContext represents an "action". 
-   * An action request is any ServletRequest or a portlet ActionRequest or 
+   * Returns <code>true</code> if this externalContext represents an "action".
+   * An action request is any ServletRequest or a portlet ActionRequest or
    * ResourceRequest.
    *
    * @param ec the current external context
    * @return a boolean of <code>true</code> if this request is an action-type
    *         request.
    * @see #isRequestFromClient(ExternalContext)
-   *         
+   *
    * @deprecated replaced with {@link #isRequestFromClient(ExternalContext)}
    */
   @Deprecated
@@ -392,11 +393,11 @@ public final class ExternalContextUtils
    * check of the current request. If more capabilities need to be tested for
    * the given request, then it is more efficient to pull this information from
    * the RequestType itself.
-   * 
+   *
    * @param ec the current external context
    * @return a boolean value of <code>true</code> if the current RequestType
    *         is a portlet request.
-   * 
+   *
    * @see RequestType#isPortlet()
    * @see #getRequestType(ExternalContext)
    */
@@ -411,11 +412,11 @@ public final class ExternalContextUtils
    * quick check of the current request. If more capabilities need to be tested
    * for the given request, then it is more efficient to pull this information
    * from the RequestType itself.
-   * 
+   *
    * @param ec the current external context
    * @return a boolean value of <code>true</code> if the current RequestType
    *         is a "render" type response.
-   * 
+   *
    * @see RequestType#isResponseWritable()
    * @see #getRequestType(ExternalContext)
    * @since 2.0
@@ -431,11 +432,11 @@ public final class ExternalContextUtils
    * quick check of the current request. If more capabilities need to be tested
    * for the given request, then it is more efficient to pull this information
    * from the RequestType itself.
-   * 
+   *
    * @param ec the current external context
    * @return a boolean value of <code>true</code> if the current RequestType
    *         represents a request from the client.
-   * 
+   *
    * @see RequestType#isResponseWritable()
    * @see #getRequestType(ExternalContext)
    * @since 2.0
@@ -444,15 +445,15 @@ public final class ExternalContextUtils
   {
     return getRequestType(ec).isRequestFromClient();
   }
-  
+
   /**
    * Returns wherther of not this external context represents a true HttpServletRequest or
-   * not.  Some portal containers implement the PortletRequest/Response objects as 
+   * not.  Some portal containers implement the PortletRequest/Response objects as
    * HttpServletRequestWrappers, and those objects should not be treated as an
    * HttpServlerRequest.  As such, this method first tests to see if the request is
    * a portlet request and, if not, then tests to see if the request is an instanceof
    * HttpServletRequest.
-   * 
+   *
    * @param ec the current external context
    * @return a boolean value of <code>true</code> if the current request is an
    *         HttpServletRequest
@@ -462,10 +463,29 @@ public final class ExternalContextUtils
   {
     return (!isPortlet(ec) && (ec.getRequest() instanceof HttpServletRequest));
   }
-  
+
+  /**
+   * Provides access to {@link ServletRequest#isSecure()} or {@link javax.portlet.PortletRequest#isSecure()}
+   * @param ec
+   * @return
+   */
+  public static boolean isSecure(
+    ExternalContext ec)
+  {
+    Object req = ec.getRequest();
+    if (isPortlet(ec))
+    {
+      return (Boolean)_runMethod(req, "isSecure");
+    }
+    else
+    {
+      return ((ServletRequest)req).isSecure();
+    }
+  }
+
   /**
    * Runs a method on an object and returns the result
-   * 
+   *
    * @param obj the object to run the method on
    * @param methodName the name of the method
    * @return the results of the method run
@@ -483,7 +503,7 @@ public final class ExternalContextUtils
     }
 
   }
-  
+
   // prevent this from being instantiated
   private ExternalContextUtils()
   {}
@@ -517,7 +537,7 @@ public final class ExternalContextUtils
 
       try
       {
-        resourceRequest = ClassLoaderUtils.loadClass("javax.portlet.ResourceRequest"); 
+        resourceRequest = ClassLoaderUtils.loadClass("javax.portlet.ResourceRequest");
       }
       catch (ClassNotFoundException e)
       {
@@ -534,19 +554,19 @@ public final class ExternalContextUtils
       renderRequest = null;
       resourceRequest = null;
     }
-    
+
     //Find bridge to tell if portal is supported
-    if(context != null) 
+    if(context != null)
     {
       try
       {
         Class<?> bridge = ClassLoaderUtils.loadClass("javax.portlet.faces.Bridge");
-        
+
         if(bridge != null)
         {
           portlet10Supported = true;
 
-          //Standard bridge defines a spec name which can be used to 
+          //Standard bridge defines a spec name which can be used to
           //determine Portlet 2.0 Support.
           String specName = bridge.getPackage().getSpecificationTitle();
           _LOG.fine("Found Bridge: " + specName);
@@ -554,11 +574,11 @@ public final class ExternalContextUtils
           {
             portlet20Supported = true;
           }
-          
+
           if(_LOG.isInfo())
           {
             String ver = (portlet20Supported)?"2.0":"1.0";
-            _LOG.info("Portlet Environment Detected: " + ver);            
+            _LOG.info("Portlet Environment Detected: " + ver);
           }
         }
       }

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 06/36: Implement JIRA-1668 by storing the id attribute on the UIXComponentBase itself and modifying the UIXFacesBeanImpl to delegate back to the UIXComponentBase for id access through the AttributeMap. I also cleaned up the way that ids and clientIds are generated so that getId() will never return a null id. In order to make the UIXComponentBase change backwards compatible, I moved the UIXFacesBeanImpl and UIXEditableFacesBeanImpl classes to api where our customers can take advantage of them and [...]

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 6e06ca9a62a5fa31d7614afe44bcfaff335d3b6f
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Wed Jan 20 22:40:57 2010 +0000

    Implement JIRA-1668 by storing the id attribute on the UIXComponentBase itself and modifying the UIXFacesBeanImpl to delegate back to the UIXComponentBase for id access through the AttributeMap.  I also cleaned up the way that ids and clientIds are generated so that getId() will never return a null id. In order to make the UIXComponentBase change backwards compatible, I moved the UIXFacesBeanImpl and UIXEditableFacesBeanImpl classes to api where our customers can take advantage of the [...]
    ### DON'T KNOW WHY THE NEXT LINE SHOULD BE NECESSARY!
    org.apache.myfaces.trinidad.component.UIXSelectRange|org.apache.myfaces.trinidad.ChoiceBar=org.apache.myfaces.trinidadinternal.bean.UIXEditableFacesBeanImpl
    
    in the faces-bean.properties
---
 .../myfaces/trinidad/bean/FacesBeanImpl.java       |   2 +
 .../trinidad/component/UIXComponentBase.java       | 152 +++++++++++++--------
 .../component}/UIXEditableFacesBeanImpl.java       | 101 +++++++++-----
 .../trinidad/component/UIXFacesBeanImpl.java       | 144 +++++++++++++++++++
 .../main/resources/META-INF/faces-bean.properties  |  21 +++
 .../trinidad/component/FindComponentTest.java      |   5 +-
 .../trinidad/component/UIXComponentBean.java       |  41 ------
 .../trinidad/component/UIXEditableValueBean.java   |  37 -----
 .../trinidad/util/FindRelativeComponentTest.java   |   6 +-
 .../test/resources/META-INF/faces-bean.properties  |  19 ---
 .../trinidadinternal/bean/UIXFacesBeanImpl.java    |  45 ------
 .../main/resources/META-INF/faces-bean.properties  |   4 -
 .../context/PartialTriggersTest.java               |   5 +-
 .../renderkit/RenderKitTestCase.java               |   4 +-
 14 files changed, 338 insertions(+), 248 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
index 362538b..b03767c 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
@@ -330,6 +330,7 @@ abstract public class FacesBeanImpl implements FacesBean
       _expressions.markInitialState();
   }
 
+  @Override
   public void restoreState(FacesContext context, Object state)
   {
     if (_LOG.isFiner())
@@ -359,6 +360,7 @@ abstract public class FacesBeanImpl implements FacesBean
     _getPropertyMap().restoreState(context, getType(), state);
   }
 
+  @Override
   public Object saveState(FacesContext context)
   {
     if (_LOG.isFiner())
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
index e37d8fb..d886fe5 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
@@ -28,7 +28,6 @@ import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.NoSuchElementException;
 import java.util.Properties;
 
 import javax.el.ELContext;
@@ -40,6 +39,7 @@ import javax.faces.FacesException;
 import javax.faces.component.ContextCallback;
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.el.EvaluationException;
 import javax.faces.el.MethodBinding;
@@ -62,6 +62,7 @@ import org.apache.myfaces.trinidad.event.AttributeChangeListener;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.render.ExtendedRenderer;
 import org.apache.myfaces.trinidad.render.LifecycleRenderer;
+import org.apache.myfaces.trinidad.util.CollectionUtils;
 import org.apache.myfaces.trinidad.util.ThreadLocalUtils;
 
 
@@ -103,8 +104,6 @@ abstract public class UIXComponentBase extends UIXComponent
   static public final FacesBean.Type TYPE = _createType();
   static public final PropertyKey ID_KEY =
     TYPE.registerKey("id", String.class, PropertyKey.CAP_NOT_BOUND);
-  static private final PropertyKey _GENERATED_ID_KEY =
-    TYPE.registerKey("_genId", String.class, PropertyKey.CAP_NOT_BOUND);
   static public final PropertyKey RENDERED_KEY =
     TYPE.registerKey("rendered", Boolean.class, Boolean.TRUE);
   static public final PropertyKey BINDING_KEY =
@@ -310,20 +309,11 @@ abstract public class UIXComponentBase extends UIXComponent
   @Override
   public String getClientId(FacesContext context)
   {
-    // NOTE - client ids cannot be cached because the generated
-    // value has to be dynamically calculated in some cases (UIData)
-
+    // the clientId is always at least the id of the current component
+    // our implementation of getId() guarantees that this always
+    // returns a non-null value
     String clientId = getId();
-    if (clientId == null)
-    {
-      clientId = (String) getProperty(_GENERATED_ID_KEY);
-      if (clientId == null)
-      {
-        clientId = context.getViewRoot().createUniqueId();
-        setProperty(_GENERATED_ID_KEY, clientId);
-      }
-    }
-
+            
     // Search for an ancestor that is a naming container
     UIComponent containerComponent = getParent();
     while (null != containerComponent)
@@ -356,12 +346,42 @@ abstract public class UIXComponentBase extends UIXComponent
 
 
   /**
-   * Gets the identifier for the component.
+   * Gets the identifier for the component.  This implementation
+   * never returns a null id.
    */
   @Override
   public String getId()
-  {
-    return (String) getProperty(ID_KEY);
+  {  
+    // determine whether we can use the optimized code path or not
+    if (_usesFacesBeanImpl)
+    {
+      // optimized path
+    
+      // make sure that we always have an id
+      if (_id == null)
+      {
+        _id = FacesContext.getCurrentInstance().getViewRoot().createUniqueId();        
+      }
+      
+      return _id;
+    }
+    else
+    {
+      // unoptimized path
+      FacesBean facesBean = getFacesBean();
+
+      String id = (String)facesBean.getProperty(ID_KEY);
+
+      // make sure that we always have an id
+      if (id == null)
+      {
+        id = FacesContext.getCurrentInstance().getViewRoot().createUniqueId();
+        
+        facesBean.setProperty(ID_KEY, id);
+      }
+      
+      return id;
+    }
   }
 
 
@@ -377,19 +397,28 @@ abstract public class UIXComponentBase extends UIXComponent
   @Override
   public void setId(String id)
   {
-    // =-=AEW Currently, setId() assumes that resetting to
-    // the same value *is not* short-circuited.
-    _validateId(id);
-    // If we're setting the ID to null, don't discard
-    // the _GENERATED_ID
-    if (id != null)
-      setProperty(_GENERATED_ID_KEY, null);
-
-    setProperty(ID_KEY, id);
+    FacesBean facesBean = getFacesBean();
+    
+    // if we are using a FacesBeanImpl, then the FacesBean will
+    // delegate all calls to set the id back to us and we can store
+    // the value localy.  Otehrwise,w e need to store it in
+    // the FacesBean
+    if (_usesFacesBeanImpl)
+    {
+      // only validate if the id has actually changed
+      if ((_id == null) || !_id.equals(id))
+      {
+        _validateId(id);
+        _id = id;
+      }      
+    }
+    else
+    {
+      _validateId(id);
+      facesBean.setProperty(ID_KEY, id);      
+    }
   }
 
-
-
   @Override
   abstract public String getFamily();
 
@@ -1589,11 +1618,39 @@ abstract public class UIXComponentBase extends UIXComponent
     String rendererType)
   {
     FacesBean oldBean = _facesBean;
-    _facesBean = createFacesBean(rendererType);
+    FacesBean newBean = createFacesBean(rendererType);;
+                                                      
     if (oldBean != null)
-      _facesBean.addAll(oldBean);
+      newBean.addAll(oldBean);
 
-    _attributes = new ValueMap(_facesBean);
+    _attributes = new ValueMap(newBean);
+    
+    _facesBean = newBean;
+    
+    // determine whether it is ok to store the attributes locally.  We cache the result since
+    // this can be a little involved
+    boolean usesFacesBeanImpl = false;
+    
+    if (newBean instanceof UIXFacesBeanImpl)
+      usesFacesBeanImpl = true;
+    else
+    {
+      // handle the wrapped case
+      FacesBean currImpl = newBean;
+      
+      while (currImpl instanceof FacesBeanWrapper)
+      {
+        currImpl = ((FacesBeanWrapper)currImpl).getWrappedBean();
+        
+        if (currImpl instanceof UIXFacesBeanImpl)
+        {
+          usesFacesBeanImpl = true;
+          break;
+        }
+      }
+    }
+      
+    _usesFacesBeanImpl = usesFacesBeanImpl;
   }
 
   private FacesBean                _facesBean;
@@ -1601,7 +1658,9 @@ abstract public class UIXComponentBase extends UIXComponent
   private Map<String, Object>      _attributes;
   private Map<String, UIComponent> _facets;
   private UIComponent              _parent;
-
+  private String                   _id;
+  private boolean                  _usesFacesBeanImpl;
+  
   // Cached instance of the Renderer for this component.
   // The instance will be re-retrieved in encodeBegin()
   private transient Renderer _cachedRenderer = _UNDEFINED_RENDERER;
@@ -1613,12 +1672,10 @@ abstract public class UIXComponentBase extends UIXComponent
   //        So commented out, is that ok? If so, this attribute should be deleted
   //private transient boolean _initialStateMarked;
 
-  private static final Iterator<String> _EMPTY_STRING_ITERATOR =
-    new EmptyIterator<String>();
+  private static final Iterator<String> _EMPTY_STRING_ITERATOR = CollectionUtils.emptyIterator();
 
   private static final Iterator<UIComponent> _EMPTY_UICOMPONENT_ITERATOR =
-    new EmptyIterator<UIComponent>();
-
+                                                                  CollectionUtils.emptyIterator();
 
   static private final ThreadLocal<StringBuilder> _STRING_BUILDER =
                                                           ThreadLocalUtils.newRequestThreadLocal();
@@ -1671,25 +1728,6 @@ abstract public class UIXComponentBase extends UIXComponent
   {
   }
 
-  private static class EmptyIterator<T> implements Iterator<T>
-  {
-    public boolean hasNext()
-    {
-      return false;
-    }
-
-    public T next()
-    {
-      throw new NoSuchElementException();
-    }
-
-    public void remove()
-    {
-      throw new UnsupportedOperationException();
-    }
-
-  }
-
   static private final LifecycleRenderer _UNDEFINED_LIFECYCLE_RENDERER =
                                                 new ExtendedRendererImpl();
   static private final Renderer _UNDEFINED_RENDERER = new RendererImpl();
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXEditableFacesBeanImpl.java
similarity index 51%
rename from trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java
rename to trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXEditableFacesBeanImpl.java
index da5bfbd..22fee2f 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXEditableFacesBeanImpl.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXEditableFacesBeanImpl.java
@@ -1,37 +1,64 @@
-/*
- *  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.trinidadinternal.bean;
-
-import org.apache.myfaces.trinidad.bean.PropertyKey;
-import org.apache.myfaces.trinidad.component.UIXEditableValue;
-
-public class UIXEditableFacesBeanImpl extends UIXFacesBeanImpl
-{
-  public UIXEditableFacesBeanImpl()
-  {
-  }
-
-  @Override
-  public void setProperty(PropertyKey key, Object value)
-  {
-    super.setProperty(key, value);
-    if (key == UIXEditableValue.VALUE_KEY)
-      setProperty(UIXEditableValue.LOCAL_VALUE_SET_KEY, Boolean.TRUE);
-  }
-}
+/*
+ *  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.trinidad.component;
+
+import org.apache.myfaces.trinidad.bean.PropertyKey;
+
+/**
+ * UIXFacesBeanImpl subclass that implements the local value contract needed for ValueHolders.
+ * UIXEditableValue subclasses that wish to modify their FacesBean behavior should subclass
+ * this class.
+ * @see org.apache.myfaces.trinidad.bean.FacesBeanImpl
+ * @see org.apache.myfaces.trinidad.component.UIXEditableValue
+ */
+public class UIXEditableFacesBeanImpl extends UIXFacesBeanImpl
+{
+  public UIXEditableFacesBeanImpl()
+  {
+  }
+
+  /**
+   * Subclassers most call super with the component and type
+   * @param component UIXEditableValue to bind to this UIXFacesBean
+   * @param type
+   * @throws IllegalStateException if init() called more than once
+   * @throws IllegalArgumentException if component is not a UIXEditableValue
+   * @throws NullPointerException of component or type is null
+   */
+  @Override
+  public void init(
+    UIXComponent component,
+    Type type)
+  {
+    // UIXFacesBeanImpl only works with UIXComponentBase
+    if (!(component instanceof UIXEditableValue))
+      throw new IllegalArgumentException(component.getClass() +" is not a UIXEditableValue");
+
+    super.init(component, type);
+  }
+  
+
+  @Override
+  public void setProperty(PropertyKey key, Object value)
+  {
+    super.setProperty(key, value);
+    if (key == UIXEditableValue.VALUE_KEY)
+      setProperty(UIXEditableValue.LOCAL_VALUE_SET_KEY, Boolean.TRUE);
+  }
+}
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java
new file mode 100644
index 0000000..f27540b
--- /dev/null
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java
@@ -0,0 +1,144 @@
+/*
+ *  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.trinidad.component;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.trinidad.bean.FacesBeanImpl;
+import org.apache.myfaces.trinidad.bean.PropertyKey;
+
+/**
+ * FacesBeanImpl subclass that implements UIXFacesBean.  UIXComponentBase subclasses that want to
+ * change the behavior of their associated FacesBean are encouraged to subclass this class in preference
+ * to implementing the FacesBean and UIXFaceBean contracts directly.  In addition, while
+ * UIXComponentBase will work with any UIXFacesBean, it is optimized to work with
+ * UIXFacesBeanImpl.
+ * @see org.apache.myfaces.trinidad.bean.FacesBean
+ * @see org.apache.myfaces.trinidad.bean.FacesBeanImpl
+ * @see org.apache.myfaces.trinidad.component.UIXFacesBean
+ * @see org.apache.myfaces.trinidad.component.UIXComponentBase
+ */
+public class UIXFacesBeanImpl extends FacesBeanImpl implements UIXFacesBean
+{
+  public UIXFacesBeanImpl()
+  {
+  }
+
+  @Override
+  public final Type getType()
+  {
+    return _type;
+  }
+
+  /**
+   * @return the UIXComponent that this UIXFacesBean as initialized with
+   */
+  public final UIXComponent getComponent()
+  {
+    return _component;
+  }
+
+  /**
+   * Subclassers most call super with the component and type
+   * @param component UIXComponentBase to bind to this UIXFacesBean
+   * @param type
+   * @throws IllegalStateException if init() called a second time with a different component or if
+   * the Type changes for one non-null Type to another
+   * @throws IllegalArgumentException if component is not a UIXComponentBase
+   * @throws NullPointerException of component is null
+   */
+  @Override
+  public void init(
+    UIXComponent component,
+    Type type)
+  {
+    // component can only be specified once
+    if ((_component != null) && (_component != component))
+      throw new IllegalStateException("FacesBean Component Changed");
+ 
+    // type can only be specified once
+    if ((_type != null) && (_type != type))
+      throw new IllegalStateException("FacesBean Type Changed");
+       
+    // UIXFacesBeanImpl only works with UIXComponentBase
+    if (!(component instanceof UIXComponentBase))
+      throw new IllegalArgumentException(component.getClass() +" is not a UIXComponentBase");
+    
+    if (component == null)
+      throw new NullPointerException("UIXFacesBean must have a component");
+
+    _type = type;
+    _component = component;
+  }  
+
+
+  @Override
+  public void setPropertyImpl(PropertyKey key, Object value)
+  {
+    // delegate sets of the id back to the UIXComponent
+    if (key == UIXComponentBase.ID_KEY)
+    {
+      _component.setId((String)value);
+    }
+    else
+    {
+      super.setPropertyImpl(key, value);
+    }
+  }
+
+  @Override
+  protected Object getLocalPropertyImpl(PropertyKey key)
+  {
+    if (key == UIXComponentBase.ID_KEY)
+    {
+      return _component.getId();
+    }
+    else
+    {
+      return super.getLocalPropertyImpl(key);
+    }
+  }
+
+  @Override
+  public Object saveState(FacesContext context)
+  {
+    // save the id in addition to the rest of the FacesBean state
+    Object[] addIdState = new Object[2];
+    
+    addIdState[0] = _component.getId();
+    addIdState[1] = super.saveState(context);
+    
+    return addIdState;
+  }
+
+  @Override
+  public void restoreState(FacesContext context, Object state)
+  {
+    // restore the id in addition to the rest of the FacesBean state
+    Object[] addIdState = (Object[])state;
+    assert addIdState.length == 2;
+    
+    _component.setId((String)addIdState[0]);
+    super.restoreState(context, addIdState[1]);
+  }
+  
+  
+  private Type _type;
+  private UIXComponent _component;
+}
diff --git a/trinidad-api/src/main/resources/META-INF/faces-bean.properties b/trinidad-api/src/main/resources/META-INF/faces-bean.properties
new file mode 100644
index 0000000..9db3ad5
--- /dev/null
+++ b/trinidad-api/src/main/resources/META-INF/faces-bean.properties
@@ -0,0 +1,21 @@
+#
+#  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.
+#
+#### <component-package-qualified-class-name>[|<renderer-type>]=<facesbean-package-qualified-class-name> ###
+org.apache.myfaces.trinidad.component.UIXComponentBase=org.apache.myfaces.trinidad.component.UIXFacesBeanImpl
+org.apache.myfaces.trinidad.component.UIXEditableValue=org.apache.myfaces.trinidad.component.UIXEditableFacesBeanImpl
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/FindComponentTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/FindComponentTest.java
index eda3aac..0da275f 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/FindComponentTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/FindComponentTest.java
@@ -24,12 +24,13 @@ import javax.faces.component.UIForm;
 import javax.faces.component.UIViewRoot;
 
 import junit.framework.Test;
-import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
 import org.apache.myfaces.trinidad.component.UIXPanel;
 
-public class FindComponentTest extends TestCase
+public class FindComponentTest extends FacesTestCase
 {
   public static final Test suite()
   {
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXComponentBean.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXComponentBean.java
deleted file mode 100644
index af1b70d..0000000
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXComponentBean.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *  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.trinidad.component;
-
-import org.apache.myfaces.trinidad.bean.FacesBeanImpl;
-import org.apache.myfaces.trinidad.component.UIXComponent;
-import org.apache.myfaces.trinidad.component.UIXFacesBean;
-
-public class UIXComponentBean extends FacesBeanImpl implements UIXFacesBean
-{
-  @Override
-  public Type getType()
-  {
-    return _type;
-  }
-
-  public void init(
-    UIXComponent   component,
-    Type type)
-  {
-    _type = type;
-  }
-
-  private Type _type;
-}
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXEditableValueBean.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXEditableValueBean.java
deleted file mode 100644
index e2790d9..0000000
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXEditableValueBean.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  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.trinidad.component;
-
-import org.apache.myfaces.trinidad.bean.PropertyKey;
-
-public class UIXEditableValueBean extends UIXComponentBean
-{
-  /**
-   * Subclass for editable components;  beans here have an
-   * additional responsibility, which is to automatically
-   * set "localValueSet" any time the value is set.
-   */
-  @Override
-  public void setProperty(PropertyKey key, Object value)
-  {
-    super.setProperty(key, value);
-    if (key == UIXEditableValue.VALUE_KEY)
-      setProperty(UIXEditableValue.LOCAL_VALUE_SET_KEY, Boolean.TRUE);
-  }
-}
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/FindRelativeComponentTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/FindRelativeComponentTest.java
index 12f80a5..7bfa840 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/FindRelativeComponentTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/FindRelativeComponentTest.java
@@ -18,8 +18,6 @@
  */
 package org.apache.myfaces.trinidad.util;
 
-import junit.framework.TestCase;
-
 import javax.faces.component.NamingContainer;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIForm;
@@ -32,7 +30,9 @@ import org.apache.myfaces.trinidad.component.UIXInput;
 import org.apache.myfaces.trinidad.component.UIXPanel;
 import org.apache.myfaces.trinidad.component.UIXTable;
 
-public class FindRelativeComponentTest extends TestCase
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
+public class FindRelativeComponentTest extends FacesTestCase
 {
   public static final Test suite()
   {
diff --git a/trinidad-api/src/test/resources/META-INF/faces-bean.properties b/trinidad-api/src/test/resources/META-INF/faces-bean.properties
deleted file mode 100644
index 22c424f..0000000
--- a/trinidad-api/src/test/resources/META-INF/faces-bean.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-#    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.
-
-org.apache.myfaces.trinidad.component.UIXComponentBase=org.apache.myfaces.trinidad.component.UIXComponentBean
-org.apache.myfaces.trinidad.component.UIXEditableValue=org.apache.myfaces.trinidad.component.UIXEditableValueBean
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java
deleted file mode 100644
index e248928..0000000
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/bean/UIXFacesBeanImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  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.trinidadinternal.bean;
-
-import org.apache.myfaces.trinidad.bean.FacesBeanImpl;
-import org.apache.myfaces.trinidad.component.UIXComponent;
-import org.apache.myfaces.trinidad.component.UIXFacesBean;
-
-public class UIXFacesBeanImpl extends FacesBeanImpl implements UIXFacesBean
-{
-  public UIXFacesBeanImpl()
-  {
-  }
-
-  @Override
-  public Type getType()
-  {
-    return _type;
-  }
-
-  public void init(
-    UIXComponent   component,
-    Type type)
-  {
-    _type = type;
-  }  
-
-  private Type _type;
-}
diff --git a/trinidad-impl/src/main/resources/META-INF/faces-bean.properties b/trinidad-impl/src/main/resources/META-INF/faces-bean.properties
index e201cd3..fc90cd3 100644
--- a/trinidad-impl/src/main/resources/META-INF/faces-bean.properties
+++ b/trinidad-impl/src/main/resources/META-INF/faces-bean.properties
@@ -17,10 +17,6 @@
 #  under the License.
 #
 #### <component-package-qualified-class-name>[|<renderer-type>]=<facesbean-package-qualified-class-name> ###
-org.apache.myfaces.trinidad.component.UIXComponentBase=org.apache.myfaces.trinidadinternal.bean.UIXFacesBeanImpl
-org.apache.myfaces.trinidad.component.UIXEditableValue=org.apache.myfaces.trinidadinternal.bean.UIXEditableFacesBeanImpl
-### DON'T KNOW WHY THE NEXT LINE SHOULD BE NECESSARY!
-org.apache.myfaces.trinidad.component.UIXSelectRange|org.apache.myfaces.trinidad.ChoiceBar=org.apache.myfaces.trinidadinternal.bean.UIXEditableFacesBeanImpl
 ### Old "UIX" renderers and associated beans
 org.apache.myfaces.trinidad.component.UIXCommand|org.apache.myfaces.trinidad.NavigationItem=org.apache.myfaces.trinidadinternal.uinode.nav.CommandNavigationItemFacesBean
 org.apache.myfaces.trinidad.component.UIXProcess|org.apache.myfaces.trinidad.ChoiceBar=org.apache.myfaces.trinidadinternal.uinode.nav.ProcessChoiceBarFacesBean
diff --git a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/PartialTriggersTest.java b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/PartialTriggersTest.java
index 64ff6eb..e909648 100644
--- a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/PartialTriggersTest.java
+++ b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/PartialTriggersTest.java
@@ -26,7 +26,6 @@ import javax.faces.component.UIForm;
 import javax.faces.component.UIViewRoot;
 
 import junit.framework.Test;
-import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
 import org.apache.myfaces.trinidad.component.UIXCommand;
@@ -35,7 +34,9 @@ import org.apache.myfaces.trinidad.component.UIXPanel;
 import org.apache.myfaces.trinidad.component.UIXTable;
 import org.apache.myfaces.trinidad.context.RequestContext;
 
-public class PartialTriggersTest extends TestCase
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
+public class PartialTriggersTest extends FacesTestCase
 {
   public static final Test suite()
   {
diff --git a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitTestCase.java b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitTestCase.java
index e3431e9..228a2ab 100644
--- a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitTestCase.java
+++ b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitTestCase.java
@@ -47,6 +47,8 @@ import org.apache.myfaces.trinidad.context.RequestContext;
 import org.apache.myfaces.trinidad.render.ExtendedRenderKitService;
 import org.apache.myfaces.trinidad.util.Service;
 
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
 import org.apache.myfaces.trinidadinternal.io.XhtmlResponseWriter;
 
 import junit.framework.AssertionFailedError;
@@ -99,7 +101,7 @@ abstract public class RenderKitTestCase extends TestSuite
   }
 
 
-  abstract public class BaseTest extends TestCase
+  abstract public class BaseTest extends FacesTestCase
   {
     public BaseTest(String name,
                     SuiteDefinition definition)

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 29/36: porting to revision 920595 to this branch:

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 7422113d67d68e9b91e5ec62ec234b0142661770
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Tue Mar 9 16:16:32 2010 +0000

    porting to revision 920595 to this branch:
    
    updated CompRef test and (temporary) change writeReplace to be protected...
---
 .../myfaces/trinidad/util/ComponentReference.java  | 11 ++--
 .../trinidad/util/ComponentReferenceTest.java      | 67 ++++++++--------------
 2 files changed, 29 insertions(+), 49 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java
index 39f8b02..6148051 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java
@@ -20,6 +20,7 @@ package org.apache.myfaces.trinidad.util;
 
 import java.io.InvalidObjectException;
 import java.io.ObjectInputStream;
+import java.io.ObjectStreamException;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -407,7 +408,7 @@ public abstract class ComponentReference<T extends UIComponent> implements Seria
     return _createScopedId(scopedIdLength, scopedIdList, componentId);
   }
 
-  private Object writeReplace()
+  protected Object writeReplace() throws ObjectStreamException
   {
     // Only use the proxy when Serializing
     return new SerializationProxy(getScopedId());
@@ -575,7 +576,7 @@ public abstract class ComponentReference<T extends UIComponent> implements Seria
     private final String _componentId;
     private final String _scopedId;
 
-    private static final long serialVersionUID = 0L;
+    private static final long serialVersionUID = 1L;
   }
   
   /**
@@ -647,7 +648,7 @@ public abstract class ComponentReference<T extends UIComponent> implements Seria
     private transient volatile String _componentId;
     private volatile String _scopedId;
 
-    private static final long serialVersionUID = 0L;
+    private static final long serialVersionUID = 1L;
   }
 
   /**
@@ -667,7 +668,7 @@ public abstract class ComponentReference<T extends UIComponent> implements Seria
       
     private final String _scopedId;
 
-    private static final long serialVersionUID = 0L;
+    private static final long serialVersionUID = 1L;
   }
 
   private transient volatile List<Object> _componentPath;
@@ -675,5 +676,5 @@ public abstract class ComponentReference<T extends UIComponent> implements Seria
   private static final String _FINISH_INITIALIZATION_LIST_KEY = ComponentReference.class.getName() +
                                                                 "#FINISH_INITIALIZATION";
   
-  private static final long serialVersionUID = -6803949269368863899L;
+  private static final long serialVersionUID = -6803949693688638969L;
 }
\ No newline at end of file
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
index 1558a6b..f4f9173 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
@@ -18,9 +18,9 @@
  */
 package org.apache.myfaces.trinidad.util;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
@@ -74,7 +74,7 @@ public class ComponentReferenceTest extends FacesTestCase
   }
 
   @SuppressWarnings("unchecked")
-  public void testFailoverOnCustomFacet()
+  public void testFailoverOnCustomFacet() throws IOException, ClassNotFoundException
   {
     UIViewRoot root = facesContext.getViewRoot();
     root.setId("root");
@@ -108,36 +108,26 @@ public class ComponentReferenceTest extends FacesTestCase
     
     // find it again!
     assertEquals(input, uiRef.getComponent());
-    // fake the failover
 
-    try 
-    {
-      FileOutputStream fos = new FileOutputStream("trinidad.failover");
-      ObjectOutputStream oos = new ObjectOutputStream(fos);
+    // fake the failover
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    ObjectOutputStream oos = new ObjectOutputStream(baos);
 
-      oos.writeObject(uiRef);
+    oos.writeObject(uiRef);
 
-      FileInputStream fis = new FileInputStream("trinidad.failover");
-      ObjectInputStream ois = new ObjectInputStream(fis);
+    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+    ObjectInputStream ois = new ObjectInputStream(bais);
 
-      uiRef = (ComponentReference<UIInput>) ois.readObject();
+    uiRef = (ComponentReference<UIInput>) ois.readObject();
 
-      referencedComp = uiRef.getComponent();
-      assertEquals(input, referencedComp);
+    referencedComp = uiRef.getComponent();
+    assertEquals(input, referencedComp);
 
-      // clean up...
-      File failoverFile = new File("trinidad.failover");
-      failoverFile.delete();
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-    }
   }
 
   
   @SuppressWarnings("unchecked")
-  public void testFailover()
+  public void testFailover() throws IOException, ClassNotFoundException
   {
     UIViewRoot root = facesContext.getViewRoot();
     root.setId("root");
@@ -154,30 +144,19 @@ public class ComponentReferenceTest extends FacesTestCase
     assertEquals(input1, referencedComp);
     
     // fake the failover
-    try 
-    {
-      FileOutputStream fos = new FileOutputStream("trinidad.failover");
-      ObjectOutputStream oos = new ObjectOutputStream(fos);
-
-      oos.writeObject(uiRef);
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    ObjectOutputStream oos = new ObjectOutputStream(baos);
 
-      FileInputStream fis = new FileInputStream("trinidad.failover");
-      ObjectInputStream ois = new ObjectInputStream(fis);
+    oos.writeObject(uiRef);
+    oos.flush();
 
-      uiRef = (ComponentReference<UIInput>) ois.readObject();
+    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+    ObjectInputStream ois = new ObjectInputStream(bais);
 
-      referencedComp = uiRef.getComponent();
-      assertEquals(input1, referencedComp);
+    uiRef = (ComponentReference<UIInput>) ois.readObject();
 
-      // clean up...
-      File failoverFile = new File("trinidad.failover");
-      failoverFile.delete();
-    }
-    catch (Exception e)
-    {
-      e.printStackTrace();
-    }
-    
+    referencedComp = uiRef.getComponent();
+    assertEquals(input1, referencedComp);
   }
 
   public void testEmptyViewRootOnGetComponent()

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 24/36: TRINIDAD-1669 Improve transient memory consumption of UIXComponentBase.getClientId()

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit e9a5acc1103a79ce44dfd5f4b0741cb8eb63cca6
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Fri Feb 26 01:26:43 2010 +0000

    TRINIDAD-1669 Improve transient memory consumption of UIXComponentBase.getClientId()
    
    Patch to test out client id caching using the flag org.apache.myfaces.trinidadinternal.ENABLE_CLIENT_ID_CACHING to enable the behavior
---
 .../trinidad/component/UIXComponentBase.java       | 71 ++++++++++++++++++----
 .../myfaces/trinidad/render/RenderUtilsTest.java   | 40 ++++++------
 2 files changed, 80 insertions(+), 31 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
index 672fda8..bf57526 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
@@ -30,6 +30,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import java.util.concurrent.atomic.AtomicReference;
+
 import javax.el.ELContext;
 import javax.el.ELException;
 import javax.el.MethodExpression;
@@ -349,25 +353,34 @@ abstract public class UIXComponentBase extends UIXComponent
   @Override
   public String getClientId(FacesContext context)
   {
-    return _calculateClientId(context);
-/* TODO put back in when we fix all of the clientID caching issues
-    String clientId = _clientId;
-    
-    if (clientId == null)
+    if (_isClientIdCachingEnabled(context))
     {
-      clientId = _calculateClientId(context);
+      String clientId = _clientId;
       
-      if (_usesFacesBeanImpl)
-        _clientId = clientId;
+      if (clientId == null)
+      {
+        clientId = _calculateClientId(context);
+        
+        if (_usesFacesBeanImpl)
+          _clientId = clientId;
+      }
+      else
+      {
+        // for now validate success by checking the cached result against the dynamically
+        // generated result
+        String realID = _calculateClientId(context);
+        
+        if (!clientId.equals(realID))
+          throw new IllegalStateException(
+        "cached client id " + clientId + " for " + this + " doesn't match client id:" + realID);
+      }
+    
+      return clientId;
     }
     else
     {
-      assert clientId.equals(_calculateClientId(context)) :
-      "cached client id " + _clientId + " for " + this + " doesn't match client id:" + _calculateClientId(context);
+      return _calculateClientId(context);
     }
-    
-    return clientId;
-*/
   }
 
 
@@ -1768,6 +1781,38 @@ abstract public class UIXComponentBase extends UIXComponent
   {
   }
 
+  private static boolean _isClientIdCachingEnabled(FacesContext context)
+  {
+    if (context == null)
+      throw new IllegalArgumentException("FacesContext is null");
+
+    Boolean cacheClientIds = _sClientIdCachingEnabled.get();
+    
+    if (cacheClientIds == null)
+    {
+      // see if client  is enabled for the application (the default is on)
+      boolean cachingEnabled = !Boolean.TRUE.equals(
+                          context.getExternalContext().
+                          getApplicationMap().get(_INIT_PROP_CLIENT_ID_CACHING_ENABLED));
+      
+      // cache the servlet initialization value
+      _sClientIdCachingEnabled.set(cachingEnabled ? Boolean.TRUE : Boolean.FALSE);
+
+      return cachingEnabled;
+    }
+    else
+    {
+      return cacheClientIds.booleanValue();
+    }
+  }
+  
+  private static AtomicReference<Boolean> _sClientIdCachingEnabled = 
+                                                                 new AtomicReference<Boolean>(null);
+  
+  // temporary servlet initialization flag controlling whether client ID caching is enabled
+  private static final String _INIT_PROP_CLIENT_ID_CACHING_ENABLED = 
+                                      "org.apache.myfaces.trinidadinternal.ENABLE_CLIENT_ID_CACHING";
+
   static private final LifecycleRenderer _UNDEFINED_LIFECYCLE_RENDERER =
                                                 new ExtendedRendererImpl();
   static private final Renderer _UNDEFINED_RENDERER = new RendererImpl();
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/render/RenderUtilsTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/render/RenderUtilsTest.java
index 5c99990..cec224d 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/render/RenderUtilsTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/render/RenderUtilsTest.java
@@ -31,8 +31,9 @@ import org.apache.myfaces.trinidad.component.UIXForm;
 import org.apache.myfaces.trinidad.component.UIXInput;
 import org.apache.myfaces.trinidad.component.UIXPanel;
 
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
 
-public class RenderUtilsTest extends TestCase
+public class RenderUtilsTest extends FacesTestCase
 {
   public static final Test suite()
   {
@@ -89,6 +90,8 @@ public class RenderUtilsTest extends TestCase
   @SuppressWarnings("unchecked")
   public void testButtonAndNamingContainerSiblings()
   {
+    FacesContext context = FacesContext.getCurrentInstance();
+
       // rootPanel
       //     button1
       //     table1
@@ -105,41 +108,41 @@ public class RenderUtilsTest extends TestCase
       table1.getChildren().add(tableChild);
     
     String relativeId =
-      RenderUtils.getRelativeId(null, button1, "table1");
+      RenderUtils.getRelativeId(context, button1, "table1");
     assertEquals("table1", relativeId);
     
     relativeId =
-      RenderUtils.getRelativeId(null, button1, ":table1");
+      RenderUtils.getRelativeId(context, button1, ":table1");
     assertEquals("table1", relativeId);
     
     // new way would find nothing, so we'd have to get something logical
     relativeId =
-      RenderUtils.getRelativeId(null, table1, "someRandomId");
+      RenderUtils.getRelativeId(context, table1, "someRandomId");
     assertEquals("table1_Client:someRandomId", relativeId);
     
     relativeId =
-      RenderUtils.getRelativeId(null, table1, ":commandButton1");
+      RenderUtils.getRelativeId(context, table1, ":commandButton1");
     assertEquals("commandButton1", relativeId);
 
     // to get to the commandButton from the table, you need to pop out of the
     // table
     relativeId =
-      RenderUtils.getRelativeId(null, table1, "::commandButton1");
+      RenderUtils.getRelativeId(context, table1, "::commandButton1");
     assertEquals("commandButton1", relativeId);
     
     // backward compatibility test -- this was the old syntax for siblings to the table.
     // this should be found by looking at the nc's parent from findRelativeComponent
     relativeId =
-      RenderUtils.getRelativeId(null, table1, "commandButton1");
+      RenderUtils.getRelativeId(context, table1, "commandButton1");
     assertEquals("commandButton1", relativeId);
        
     // backward compatibility test -- this was the old syntax for children to the table.
     relativeId =
-      RenderUtils.getRelativeId(null, table1, "table1:tableChildId");
+      RenderUtils.getRelativeId(context, table1, "table1:tableChildId");
     assertEquals("table1:tableChildId", relativeId);
      // this is the new syntax for children to the table
     relativeId =
-      RenderUtils.getRelativeId(null, table1, "tableChildId");
+      RenderUtils.getRelativeId(context, table1, "tableChildId");
     assertEquals("table1:tableChildId", relativeId);
 
   }
@@ -150,6 +153,7 @@ public class RenderUtilsTest extends TestCase
   @SuppressWarnings("unchecked")
   public void testRelativeSearch()
   {
+    FacesContext context = FacesContext.getCurrentInstance();
 
 
       // set up component hierarchy
@@ -195,13 +199,13 @@ public class RenderUtilsTest extends TestCase
      */
       
     String relativeId =
-      RenderUtils.getRelativeId(null, input1, "::button1");
+      RenderUtils.getRelativeId(context, input1, "::button1");
     // new way should pop OUT of ONE naming container and will find it
     assertEquals("ncRoot:button1", relativeId);
 
     
     relativeId =
-      RenderUtils.getRelativeId(null, input1, ":::button1");
+      RenderUtils.getRelativeId(context, input1, ":::button1");
     // new way should pop OUT of TWO naming containers and will find not find it
     // since it is in ncRoot and the base is now the view root.
     // so it goes to the old findRelativeComponent, and this will find it.
@@ -209,27 +213,27 @@ public class RenderUtilsTest extends TestCase
 
 
     relativeId =
-      RenderUtils.getRelativeId(null, input1, "randomPeer");
+      RenderUtils.getRelativeId(context, input1, "randomPeer");
     // randomPeer doesn't exist, so new way won't find it.
     // uses code that doesn't need to find the component to return this:
     assertEquals("nc1_Client:randomPeer", relativeId);
     
     relativeId =
-      RenderUtils.getRelativeId(null, input1, "::randomPeer");
+      RenderUtils.getRelativeId(context, input1, "::randomPeer");
     // randomPeer doesn't exist, so new way won't find it.
     // uses code that doesn't need to find the component to return this:
     assertEquals("ncRoot_Client:randomPeer", relativeId);
  
     // rootButton is child of form and sibling to ncRoot. It's 2 nc up from input1
     relativeId =
-      RenderUtils.getRelativeId(null, input1, ":::rootButton");
+      RenderUtils.getRelativeId(context, input1, ":::rootButton");
     // new way should pop OUT of both NC with ::: and will find it
     assertEquals("rootButton", relativeId);
 
  
     // rootButton is child of form and sibling to ncRoot. It's 2 nc up from input1
     relativeId =
-      RenderUtils.getRelativeId(null, input1, "::rootButton");
+      RenderUtils.getRelativeId(context, input1, "::rootButton");
     // new way should pop OUT of one NC with ::, so it can't find it
     // the 'old' findRelativeComponent can't find it either.
     // so it returns what the old getRelativeId would have returned
@@ -240,19 +244,19 @@ public class RenderUtilsTest extends TestCase
     
     // rootButton is child of form and sibling to ncRoot. It's 2 nc up from input1
     relativeId =
-      RenderUtils.getRelativeId(null, input1, "::::rootButton");
+      RenderUtils.getRelativeId(context, input1, "::::rootButton");
     // new way should pop OUT of ALL NCs and will find it.
     assertEquals("rootButton", relativeId);
     
 
     
     relativeId =
-      RenderUtils.getRelativeId(null, input1, "::::button1");
+      RenderUtils.getRelativeId(context, input1, "::::button1");
     // new way should return this
     assertEquals("button1", relativeId);
     
     relativeId =
-      RenderUtils.getRelativeId(null, input1, ":::::button1");
+      RenderUtils.getRelativeId(context, input1, ":::::button1");
     assertEquals("button1", relativeId);
   }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 14/36: Make sure that the ID_KEY is present in the UIXFacesBeanImpl.java key set when the UIXFacesBeanImpl is delegating the storageof the ID property back to the UIXComponentBase.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 5ec6839e8396765037eda653ad3a4bdd0decb903
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Thu Feb 4 22:06:44 2010 +0000

    Make sure that the ID_KEY is present in the UIXFacesBeanImpl.java key set when the UIXFacesBeanImpl is delegating the storageof the ID property back to the UIXComponentBase.
---
 .../myfaces/trinidad/bean/FacesBeanImpl.java       |  14 +-
 .../myfaces/trinidad/bean/util/ValueMap.java       |   4 +-
 .../trinidad/component/UIXFacesBeanImpl.java       |  17 ++
 .../myfaces/trinidad/util/CollectionUtils.java     | 325 +++++++++++++++++++++
 4 files changed, 347 insertions(+), 13 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
index b03767c..582c6c6 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/FacesBeanImpl.java
@@ -31,8 +31,6 @@ import javax.el.ValueExpression;
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
 
-
-
 import org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
@@ -46,12 +44,6 @@ abstract public class FacesBeanImpl implements FacesBean
   {
   }
 
-  /**
-   * Get the type of a FacesBean
-   */
-  // TODO Use auto "TYPE" detection?
-  abstract public Type getType();
-
   final public Object getProperty(PropertyKey key)
   {
     Object o = getLocalProperty(key);
@@ -301,12 +293,12 @@ abstract public class FacesBeanImpl implements FacesBean
     }
   }
 
-  final public Set<PropertyKey> keySet()
+  public Set<PropertyKey> keySet()
   {
     if (_properties == null)
       return Collections.emptySet();
-
-    return _properties.keySet();
+    else
+      return _properties.keySet();
   }
 
   @SuppressWarnings("unchecked")
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/ValueMap.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/ValueMap.java
index f8ad5a6..d1a9eac 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/ValueMap.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/util/ValueMap.java
@@ -257,6 +257,6 @@ public class ValueMap extends AbstractMap<String, Object>
     throw new ClassCastException();
   }
 
-  private FacesBean    _bean;
-  private MakeEntries  _entries;
+  private final FacesBean    _bean;
+  private transient MakeEntries  _entries;
 }
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java
index f27540b..d9b7c22 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXFacesBeanImpl.java
@@ -18,10 +18,14 @@
  */
 package org.apache.myfaces.trinidad.component;
 
+import java.util.Collections;
+import java.util.Set;
+
 import javax.faces.context.FacesContext;
 
 import org.apache.myfaces.trinidad.bean.FacesBeanImpl;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.util.CollectionUtils;
 
 /**
  * FacesBeanImpl subclass that implements UIXFacesBean.  UIXComponentBase subclasses that want to
@@ -87,6 +91,17 @@ public class UIXFacesBeanImpl extends FacesBeanImpl implements UIXFacesBean
     _component = component;
   }  
 
+  @Override
+  public Set<PropertyKey> keySet()
+  {
+    // override to make sure that the id key is in the returned set.
+    Set<PropertyKey> baseSet = super.keySet();
+    
+    if (baseSet.isEmpty())
+      return _ID_KEY_SET;
+    else
+      return CollectionUtils.compositeSet(baseSet, _ID_KEY_SET);
+  }
 
   @Override
   public void setPropertyImpl(PropertyKey key, Object value)
@@ -138,6 +153,8 @@ public class UIXFacesBeanImpl extends FacesBeanImpl implements UIXFacesBean
     super.restoreState(context, addIdState[1]);
   }
   
+  // Set containing the ID Key
+  private static final Set<PropertyKey> _ID_KEY_SET =Collections.singleton(UIXComponentBase.ID_KEY);
   
   private Type _type;
   private UIXComponent _component;
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/CollectionUtils.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/CollectionUtils.java
index 6ef081d..6e26ed2 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/CollectionUtils.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/CollectionUtils.java
@@ -26,11 +26,13 @@ import java.io.Serializable;
 import java.lang.reflect.Array;
 
 import java.util.AbstractQueue;
+import java.util.AbstractSet;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.ConcurrentModificationException;
+import java.util.EnumSet;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -42,6 +44,7 @@ import java.util.Queue;
 import java.util.RandomAccess;
 import java.util.Set;
 
+import org.apache.myfaces.trinidad.component.CompositeIterator;
 import org.apache.myfaces.trinidad.context.Version;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
@@ -145,6 +148,28 @@ public final class CollectionUtils
     return _asSet(a, true);
   }
 
+  /**
+   * Returns an unmodifiable versions of the Set of Enums.  If the contents of the set are known
+   * to be unmodifiable by the caller in any way, the set itself will be retured, otherwise an
+   * unmodifiable copy of the Set will be returned.
+   * @param s Set to get the tamper-proof version of
+   * @return An unmodifiable tamper-proof version of the set
+   */
+  public static <E extends Enum<E>> Set<E> unmodifiableCopyOfEnumSet(Set<E> s)
+  {
+    Class<? extends Set> copyClass = s.getClass();
+    
+    if ((_EMPTY_SET == copyClass) || (_SINGLETON_SET == copyClass))
+    {
+      // these classes are already unmodifiable, so just return
+      return s;
+    }
+    else
+    {
+      return Collections.unmodifiableSet(EnumSet.copyOf(s));
+    }
+  }
+
   private static <T> Set<T> _asSet(T[] a, boolean makeImmutable)
   {
     int count = (a != null) ? a.length : 0;
@@ -184,6 +209,23 @@ public final class CollectionUtils
     return outSet;
   }
 
+  /**
+   * Given two disjoint sets, returns a live composition of the two Sets that maintains
+   * the disjoint invariant.  If both Sets are Serializable, the returned
+   * implementation will be Serializable as well.  The returned Set implementation is
+   * not thread safe.
+   * @param primarySet The Set that adds will be applied to
+   * @param secondarySet The other Set
+   * @return The composition of the two disjoint Sets
+   * @throws NullPointerException of primarySet or secondarySet are <code>null</code>
+   */
+  public static <T> Set<T> compositeSet(Set<T> primarySet, Set<T> secondarySet)
+  {
+    if ((primarySet instanceof Serializable) && (secondarySet instanceof Serializable))
+      return new SerializableFixedCompositeSet(primarySet, secondarySet);
+    else
+      return new FixedCompositeSet(primarySet, secondarySet);
+  }
 
   /**
    * Returns a Collection based on the passed in Collection <code>c</code>,
@@ -412,7 +454,286 @@ public final class CollectionUtils
       return getDelegate().toString();
     }
   }
+
+  /**
+   * Note: Requires contents to be disjoint!
+   * @param <E>
+   */
+  protected abstract static class CompositeCollection<E> implements Collection<E>
+  {
+    protected abstract Collection<E> getPrimaryDelegate();
+    protected abstract Collection<E> getSecondaryDelegate();
+
+    @Override
+    public int size()
+    {
+      return getPrimaryDelegate().size() + getSecondaryDelegate().size();
+    }
+
+    @Override
+    public boolean isEmpty()
+    {
+      return getPrimaryDelegate().isEmpty() || getSecondaryDelegate().isEmpty();
+    }
+
+    @Override
+    public boolean contains(Object o)
+    {
+      return getPrimaryDelegate().contains(o) || getSecondaryDelegate().contains(o);
+    }
+
+    @Override
+    public Iterator<E> iterator()
+    {
+      return new CompositeIterator(getPrimaryDelegate().iterator(),
+                                   getSecondaryDelegate().iterator());
+    }
+
+    @Override
+    public Object[] toArray()
+    {
+      int size = size();
+      
+      Object[] out = new Object[size];
+      
+      int i = 0;
+      for (Object currObject : this)
+      {
+        out[i] = currObject;
+        
+        i++;
+        
+        if (i == size)
+          break;
+      }
+      
+      return out;
+    }
+
+    @Override
+    public <T> T[] toArray(T[] outArray)
+    {
+      int collectionSize = size();
+      int arraySize = outArray.length;
+      
+      // size isn't big enough, so need a new array
+      if (collectionSize > arraySize)
+      {
+        outArray = (T[])Array.newInstance(outArray.getClass().getComponentType(),
+                                          collectionSize);
+      }
+
+      Iterator<E> iterator = this.iterator();
+      
+      for (int i = 0; i < collectionSize; i++)
+      {
+        if (!iterator.hasNext())
+          break;
+        
+        outArray[i] = (T)iterator.next();
+      }
+      
+      return outArray;
+    }
+
+    @Override
+    public boolean add(E e)
+    {
+      return getPrimaryDelegate().add(e);
+    }
+
+    @Override
+    public boolean remove(Object o)
+    {
+      boolean removed = getPrimaryDelegate().remove(0);
+      
+      if (!removed)
+        removed = getSecondaryDelegate().remove(0);
+      
+      return removed;
+    }
+
+    @Override
+    public boolean containsAll(Collection<?> c)
+    {
+      // find all of the items in both the collection and the primary delegate
+      
+      Set<Object> intersection = new HashSet<Object>(getPrimaryDelegate());
+      intersection.retainAll(c);
+            
+      if (intersection.size() == c.size())
+      {
+        // the primary delegate contained all of the items, so we're done
+        return true;
+      }
+      else
+      {
+        // compute the set of items we still haven't match in order to check against the
+        // secondary delegate
+        Set<Object> remainder = new HashSet<Object>(c);
+        remainder.removeAll(intersection);
+        
+        return getSecondaryDelegate().containsAll(remainder);
+      }
+    }
+
+    @Override
+    public boolean addAll(Collection<? extends E> c)
+    {
+      // determine the result ahead of time
+      boolean changed = !containsAll(c);
+      
+      // make sure that the collections maintain disjointness
+      getSecondaryDelegate().removeAll(c);
+      getPrimaryDelegate().addAll(c);
+      
+      return changed;
+    }
+
+    @Override
+    public boolean removeAll(Collection<?> c)
+    {
+      return getPrimaryDelegate().removeAll(c) || getSecondaryDelegate().removeAll(c);
+    }
+
+    @Override
+    public boolean retainAll(Collection<?> c)
+    {
+      return getPrimaryDelegate().retainAll(c) || getSecondaryDelegate().retainAll(c);
+    }
+
+    @Override
+    public void clear()
+    {
+      getPrimaryDelegate().clear();
+      getSecondaryDelegate().clear();
+    }
+    
+    @Override
+    public String toString()
+    {
+      return super.toString() + 
+             "[primary:" + 
+             getPrimaryDelegate() +
+             ", secondary:" +
+             getSecondaryDelegate() +
+             "]";
+    }
+  }
+  
+  /**
+   * Note: Requires contents to be disjoint!
+   * @param <E>
+   */
+  protected abstract static class CompositeSet<E> extends CompositeCollection<E> implements Set<E>
+  {
+    @Override
+    protected abstract Set<E> getPrimaryDelegate();
     
+    @Override
+    protected abstract Set<E> getSecondaryDelegate();
+
+    /**
+     * Implement Set-defined equals behavior 
+     */
+    @Override
+    public boolean equals(Object o)
+    {
+      if (o == this)
+        return true;
+      else if (!(o instanceof Set))
+        return false;
+      else
+      {
+        Collection other = (Collection) o;
+
+        if (other.size() != size())
+        {
+          return false;
+        }
+        else
+        {
+          // since the sizes are the same, if we contain all of the other collection's
+          // elements, we are identical
+          try
+          {
+            return containsAll(other);
+          }
+          catch(NullPointerException npe)
+          {
+            // optional NullPointerException that containsAll is allowed to throw
+            return false;
+          }
+          catch(ClassCastException npe)
+          {
+            // optional ClassCastException that containsAll is allowed to throw
+            return false;
+          }
+        }
+      }
+    }
+
+    /**
+     * Implement Set-defined equals behavior 
+     */
+    @Override
+    public int hashCode()
+    {
+      // Set defines hashCode() as additive based on the contents
+      return getPrimaryDelegate().hashCode() + getSecondaryDelegate().hashCode();
+    }
+  }
+  
+  /**
+   * Concrete Composite Set that takes the two sets to compose
+   */
+  private static class FixedCompositeSet<E> extends CompositeSet<E>
+  {
+    FixedCompositeSet(Set<E> primarySet, Set<E> secondarySet)
+    {
+      if (primarySet == null)
+        throw new NullPointerException();
+
+      if (secondarySet == null)
+        throw new NullPointerException();
+      
+      assert Collections.disjoint(primarySet, secondarySet) : "Composed Sets not disjoint";
+      
+      _primarySet   = primarySet;
+      _secondarySet = secondarySet;
+    }
+
+    @Override
+    protected Set<E> getPrimaryDelegate()
+    {
+      return _primarySet;
+    }
+    
+    @Override
+    protected Set<E> getSecondaryDelegate()
+    {
+      return _secondarySet;
+    }
+    
+    private final Set<E> _primarySet;
+    private final Set<E> _secondarySet;
+  }
+
+  /**
+   * Serializable version of FixedCompositeSet
+   * @param <E>
+   */
+  private static final class SerializableFixedCompositeSet<E> extends FixedCompositeSet<E>
+                                                              implements Serializable
+  {
+    SerializableFixedCompositeSet(Set<E> primarySet, Set<E> secondarySet)
+    {
+      super(primarySet, secondarySet);
+    }
+    
+    private static final long serialVersionUID = 0L;    
+  }
+  
   private static class SerializableCollection<E> extends DelegatingCollection<E>
                                                  implements Serializable
   {
@@ -965,6 +1286,10 @@ public final class CollectionUtils
   private static final Class<? extends List> _CHECKED_LIST;
   private static final Class<? extends List> _UNMODIFIABLE_LIST;
   private static final Class<? extends List> _SYNCHRONIZED_LIST;
+  private static final Class<? extends Set> _EMPTY_SET = Collections.emptySet().getClass();
+  private static final Class<? extends Set> _SINGLETON_SET = Collections.singleton(null).getClass();
+  
+
   private static final Queue _EMPTY_QUEUE = new EmptyQueue();
   private static final Iterator _EMPTY_ITERATOR = new EmptyIterator();
   private static final Iterator _EMPTY_LIST_ITERATOR = new EmptyListIterator();

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 35/36: java5 issue with TRINIDAD-1757

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit a6ac9d2084e4dc938a0bb5861e79589d62c46f02
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Tue Apr 6 10:55:49 2010 +0000

    java5 issue with TRINIDAD-1757
---
 .../config/upload/CompositeUploadedFileProcessorImpl.java               | 2 --
 1 file changed, 2 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/CompositeUploadedFileProcessorImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/CompositeUploadedFileProcessorImpl.java
index 28b6da3..b13003e 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/CompositeUploadedFileProcessorImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/CompositeUploadedFileProcessorImpl.java
@@ -65,7 +65,6 @@ public class CompositeUploadedFileProcessorImpl implements UploadedFileProcessor
     this.chainedProcessors = chainedProcessors;
   }
 
-  @Override
   public void init(Object context)
   {
     _init(context);
@@ -77,7 +76,6 @@ public class CompositeUploadedFileProcessorImpl implements UploadedFileProcessor
 
   }
 
-  @Override
   public UploadedFile processFile(Object request, UploadedFile tempFile) throws IOException
   {
     //NOTE: The following optimization was suggested at one point:

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 17/36: TRINIDAD-1714 Mark the skin as dirty if DesignTime mode and org.apache.myfaces.trinidad.skin.id is set. This is reverting the change I made for TRINIDAD-1637 always check for file modification if in DesignTime mode regardless of web.xml setting This essentially does the same thing, but it doesn't check the file for modification. It always recomputes the Skin and its css file.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 4d686bcaee9b7117a5b0d69c29c6372dfd03a5c3
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Feb 9 19:27:26 2010 +0000

    TRINIDAD-1714 Mark the skin as dirty if DesignTime mode and org.apache.myfaces.trinidad.skin.id is set.
    This is reverting the change I made for TRINIDAD-1637 always check for file modification if in DesignTime mode regardless of web.xml setting
    This essentially does the same thing, but it doesn't check the file for modification. It always recomputes the Skin and its css file.
---
 .../renderkit/core/StyleContextImpl.java           | 30 ++++++++++++----------
 .../style/cache/FileSystemStyleCache.java          |  4 +--
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
index 9eb7305..c74f34e 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
@@ -113,20 +113,6 @@ class StyleContextImpl implements StyleContext
   }
   public boolean checkStylesModified()
   {
-    if (Beans.isDesignTime())
-    {
-      // In Design Time mode, if we have a skin-id on the request scope,
-      // then this means we want to check if the skin css files are modified.
-      // This is an alternative to the initParam (CHECK_TIMESTAMP_PARAM) which
-      // is set in web.xml. Design Time cannot set the web.xml file.
-      FacesContext context = FacesContext.getCurrentInstance();
-      Object requestSkinId = 
-        ((CoreRenderingContext) _arc).getRequestMapSkinId(context);
-      if (requestSkinId != null)
-        return true;
-
-    }
-    
     FacesContext context = FacesContext.getCurrentInstance();
     String checkTimestamp =
       context.getExternalContext().getInitParameter(Configuration.CHECK_TIMESTAMP_PARAM);
@@ -137,6 +123,22 @@ class StyleContextImpl implements StyleContext
    */
   public boolean isDirty()
   {
+    if (Beans.isDesignTime())
+    {
+      // In Design Time mode, if we have a skin-id on the request scope,
+      // then this means the Design Time wants the skin to regenerate. To do this,
+      // we say the skin is dirtys
+      FacesContext context = FacesContext.getCurrentInstance();
+      Object requestSkinId = 
+        ((CoreRenderingContext) _arc).getRequestMapSkinId(context);
+      if (requestSkinId != null)
+      {
+        // set the skin to dirty as well for double insurance, like if someone checks the 
+        // skin directly to see if it is dirty.
+        _arc.getSkin().setDirty(true); 
+        return true;
+      }
+    }
     return _arc.getSkin().isDirty();
   }
 
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
index 0c17937..383f729 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
@@ -290,9 +290,7 @@ public class FileSystemStyleCache implements StyleProvider
     StyleSheetDocument document = null;
     Map<String, String> shortStyleClassMap = null;
     String[] namespacePrefixes = null;
-    RenderingContext arc = RenderingContext.getCurrentInstance();
-    Skin skin = arc.getSkin();
-    boolean isDirty = skin.isDirty();
+    boolean isDirty = context.isDirty();
     boolean checkModified  = context.checkStylesModified();
 
     // Synchronize while set up the _cache, _entryCache, _document, etc...

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 01/36: fix bug where the css file was missing most of the selectors from the .xss skinning files. The reason was that the AgentAtRuleMatcher was being checked, even for StyleSheetNode's that did not have browsers specified. Therefore only the StyleSheetNodes with browsers specified and that matched the user's browser were being included in the css.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit be698c04e6c87f570384f808c2ed941d82254869
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Jan 5 21:17:30 2010 +0000

    fix bug where the css file was missing most of the selectors from the .xss skinning files.
    The reason was that the AgentAtRuleMatcher was being checked, even for StyleSheetNode's that did not have browsers specified.
    Therefore only the StyleSheetNodes with browsers specified and that matched the user's browser were being included in the css.
---
 .../org/apache/myfaces/trinidadinternal/style/util/NameUtils.java   | 5 +++++
 .../trinidadinternal/style/xml/parse/StyleSheetNodeParser.java      | 6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
index 09ab4c1..8e25ffd 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/NameUtils.java
@@ -600,6 +600,11 @@ public class NameUtils
             return new boolean[] { true, true };          
         }
       }
+      else
+      {
+        // no agent matcher, so all agents match
+        browserMatched = true;
+      }
     }
 
     return new boolean[] { browserMatched, false };
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
index e760846..0645c50 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
@@ -87,8 +87,10 @@ public class StyleSheetNodeParser extends BaseNodeParser
       styles = new StyleNode[_styles.size()];
       _styles.copyInto(styles);
     }
-   
-    AgentAtRuleMatcher agentMatcher = new AgentAtRuleMatcher(_browsers, _versions);
+    // Do not create an agentMatcher if there are no browsers or versions to compare against.
+    // This way a styleSheetNode will match any browser if it hasn't specified a specific browser.
+    AgentAtRuleMatcher agentMatcher = 
+      (_browsers.isEmpty()) ? null : new AgentAtRuleMatcher(_browsers, _versions);
   
     return new StyleSheetNode(
         styles,

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 12/36: TRINIDAD-1696 acc (screen reader mode) layout tables should include role="presentation"

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 024abf786dc59c2b2e239030439ada3c7de71225
Author: Matthew Cooper <mc...@apache.org>
AuthorDate: Fri Jan 29 21:08:20 2010 +0000

    TRINIDAD-1696 acc (screen reader mode) layout tables should include role="presentation"
    
    Thanks to Dave Robinson for the patch:
    
    When using trh:tableLayout in our page to layout some UI components, it gives warning during Accessibility testing:
    "WARNING - This layout Table could be confused for a data table by Screen Readers"
    From the html perspective, this warning can be fixed by setting role="presentation" on the html table element.
    
    We can add role="presentation" to layout tables with the following addition to
    
    org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.OutputTextUtils.renderLayoutTableAttributes():
    
      if (CoreRenderer.isScreenReaderMode(arc))
      {
        ResponseWriter writer = context.getResponseWriter();
        writer.writeAttribute("datatable", "0", null);
    
    --> writer.writeAttribute("role", "presentation", null); <--
    
      }
---
 .../renderkit/core/xhtml/OutputUtils.java          |   1 +
 .../golden/columnGroup-minimalScrRdr-golden.xml    |   3 +
 .../golden/editableTable-minimalScrRdr-golden.xml  |   3 +
 .../golden/inputColor-minimalScrRdr-golden.xml     |  29 +++
 .../golden/inputDate-minimalScrRdr-golden.xml      |  30 +++
 .../golden/inputFile-minimalScrRdr-golden.xml      |  23 ++
 .../inputListOfValues-minimalScrRdr-golden.xml     |  48 ++++
 .../inputNumberSpinbox-minimalScrRdr-golden.xml    | 121 ++++++++++
 .../golden/inputText-minimalScrRdr-golden.xml      |  60 +++++
 .../golden/inputText-rows-minimalScrRdr-golden.xml |  44 ++++
 .../golden/messages-minimalScrRdr-golden.xml       |   9 +
 .../golden/messagesError-minimalScrRdr-golden.xml  |   9 +
 .../golden/messagesFatal-minimalScrRdr-golden.xml  |   9 +
 .../golden/messagesInfo-minimalScrRdr-golden.xml   |   9 +
 .../golden/messagesWarn-minimalScrRdr-golden.xml   |   9 +
 .../navigationPaneBar-minimalScrRdr-golden.xml     |  39 ++++
 .../navigationPaneButtons-minimalScrRdr-golden.xml |  42 ++++
 .../navigationPaneList-minimalScrRdr-golden.xml    |  39 ++++
 .../navigationPaneTabs-minimalScrRdr-golden.xml    | 156 +++++++++++++
 .../panelBorderLayout-minimalScrRdr-golden.xml     |  16 ++
 .../golden/panelBox-minimalScrRdr-golden.xml       |  25 ++
 .../golden/panelButtonBar-minimalScrRdr-golden.xml |  21 ++
 .../panelFormLayout-minimalScrRdr-golden.xml       |  61 +++++
 .../panelGroupLayout-minimalScrRdr-golden.xml      |   1 +
 .../panelHorizontalLayout-minimalScrRdr-golden.xml |  23 ++
 ...zontalLayout-separator-minimalScrRdr-golden.xml |  23 ++
 ...lLabelAndMessage-facet-minimalScrRdr-golden.xml |   5 +
 .../panelLabelAndMessage-minimalScrRdr-golden.xml  |  30 +++
 .../golden/panelList-minimalScrRdr-golden.xml      |   1 +
 .../panelPage-facets-minimalScrRdr-golden.xml      |  42 ++++
 .../panelPageHeader-minimalScrRdr-golden.xml       | 252 +++++++++++++++++++++
 .../golden/rowLayout-minimalScrRdr-golden.xml      |  24 ++
 .../selectBooleanCheckbox-minimalScrRdr-golden.xml |  33 +++
 .../selectBooleanRadio-minimalScrRdr-golden.xml    |  31 +++
 .../selectManyCheckbox-minimalScrRdr-golden.xml    |  40 ++++
 .../selectManyListBox-minimalScrRdr-golden.xml     |  34 +++
 .../selectManyShuttle-minimalScrRdr-golden.xml     | 155 +++++++++++++
 .../selectOneChoice-minimalScrRdr-golden.xml       |  34 +++
 .../selectOneListbox-minimalScrRdr-golden.xml      |  35 +++
 .../golden/selectOneRadio-minimalScrRdr-golden.xml |  40 ++++
 .../selectOrderShuttle-minimalScrRdr-golden.xml    |  80 +++++++
 .../selectRangeChoiceBar-minimalScrRdr-golden.xml  |   5 +
 ...electRangeChoiceBarBig-minimalScrRdr-golden.xml |   5 +
 .../singleStepButtonBar-minimalScrRdr-golden.xml   |   4 +
 .../golden/table-minimalScrRdr-golden.xml          |  61 +++++
 .../tableSelectMany-minimalScrRdr-golden.xml       |  12 +
 .../golden/tableSelectOne-minimalScrRdr-golden.xml |   9 +
 .../golden/train-minimalScrRdr-golden.xml          |  56 +++++
 .../golden/treeTable-minimalScrRdr-golden.xml      |  87 +++++++
 49 files changed, 1928 insertions(+)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputUtils.java
index fd96f30..39a339c 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputUtils.java
@@ -145,6 +145,7 @@ public class OutputUtils
     {
       ResponseWriter writer = context.getResponseWriter();
       writer.writeAttribute("datatable", "0", null);
+      writer.writeAttribute("role", "presentation", null); 
     }
   }
 
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/columnGroup-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/columnGroup-minimalScrRdr-golden.xml
index 1ca5aa3..f0ceede 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/columnGroup-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/columnGroup-minimalScrRdr-golden.xml
@@ -9,6 +9,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -24,6 +25,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -47,6 +49,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/editableTable-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/editableTable-minimalScrRdr-golden.xml
index 2a1b309..1b20645 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/editableTable-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/editableTable-minimalScrRdr-golden.xml
@@ -9,6 +9,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -24,6 +25,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -47,6 +49,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputColor-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputColor-minimalScrRdr-golden.xml
index 85cd89f..07a76a7 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputColor-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputColor-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -83,6 +84,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -148,6 +150,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -225,6 +228,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -291,6 +295,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -368,6 +373,7 @@
            class="af_inputColor p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -428,6 +434,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -510,6 +517,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -587,6 +595,7 @@
            class="af_inputColor p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -642,6 +651,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -719,6 +729,7 @@
            class="af_inputColor p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -801,6 +812,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -878,6 +890,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -955,6 +968,7 @@
            class="af_inputColor p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1037,6 +1051,7 @@
            class="af_inputColor p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1119,6 +1134,7 @@
            class="af_inputColor p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1201,6 +1217,7 @@
            class="af_inputColor p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1283,6 +1300,7 @@
            class="af_inputColor"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1360,6 +1378,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -1438,6 +1457,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -1523,6 +1543,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1600,6 +1621,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1678,6 +1700,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1756,6 +1779,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1834,6 +1858,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1912,6 +1937,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1990,6 +2016,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2068,6 +2095,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2146,6 +2174,7 @@
            class="af_inputColor"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputDate-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputDate-minimalScrRdr-golden.xml
index 5149a61..6f543f8 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputDate-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputDate-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -71,6 +72,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -117,6 +119,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -182,6 +185,7 @@
            class="af_inputDate p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -223,6 +227,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -293,6 +298,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -358,6 +364,7 @@
            class="af_inputDate p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -394,6 +401,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -459,6 +467,7 @@
            class="af_inputDate p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -529,6 +538,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -594,6 +604,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -659,6 +670,7 @@
            class="af_inputDate p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -729,6 +741,7 @@
            class="af_inputDate p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -799,6 +812,7 @@
            class="af_inputDate p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -869,6 +883,7 @@
            class="af_inputDate p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -939,6 +954,7 @@
            class="af_inputDate"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1004,6 +1020,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -1070,6 +1087,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -1143,6 +1161,7 @@
            class="test-styleClass af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1208,6 +1227,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1273,6 +1293,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1339,6 +1360,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1405,6 +1427,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1471,6 +1494,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1537,6 +1561,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1603,6 +1628,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1669,6 +1695,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1735,6 +1762,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1801,6 +1829,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1867,6 +1896,7 @@
            class="af_inputDate"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputFile-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputFile-minimalScrRdr-golden.xml
index ef19205..417dfa2 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputFile-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputFile-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -44,6 +45,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -83,6 +85,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -122,6 +125,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -161,6 +165,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -200,6 +205,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -239,6 +245,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -278,6 +285,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -317,6 +325,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -356,6 +365,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -395,6 +405,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -434,6 +445,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -473,6 +485,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -512,6 +525,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -551,6 +565,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -590,6 +605,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -628,6 +644,7 @@
            class="af_inputFile p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -667,6 +684,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -706,6 +724,7 @@
            class="af_inputFile"
            datatable="0"
            id="id_val__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -744,6 +763,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -783,6 +803,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -826,6 +847,7 @@
            class="af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -872,6 +894,7 @@
            class="test-styleClass af_inputFile"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputListOfValues-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputListOfValues-minimalScrRdr-golden.xml
index 364d025..c32eb0c 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputListOfValues-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputListOfValues-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -69,6 +70,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -133,6 +135,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -197,6 +200,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -260,6 +264,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -324,6 +329,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -388,6 +394,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -452,6 +459,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -516,6 +524,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -580,6 +589,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -644,6 +654,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -708,6 +719,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -772,6 +784,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -836,6 +849,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -900,6 +914,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -964,6 +979,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1027,6 +1043,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1088,6 +1105,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="id_val__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1151,6 +1169,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -1215,6 +1234,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1283,6 +1303,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1347,6 +1368,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -1418,6 +1440,7 @@
            class="styleClass_val af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1481,6 +1504,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1544,6 +1568,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1607,6 +1632,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1670,6 +1696,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1733,6 +1760,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1797,6 +1825,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1860,6 +1889,7 @@
            class="af_inputListOfValues p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1901,6 +1931,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1964,6 +1995,7 @@
            class="af_inputListOfValues p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2000,6 +2032,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2063,6 +2096,7 @@
            class="af_inputListOfValues p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2131,6 +2165,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2194,6 +2229,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2257,6 +2293,7 @@
            class="af_inputListOfValues p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2325,6 +2362,7 @@
            class="af_inputListOfValues p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2393,6 +2431,7 @@
            class="af_inputListOfValues p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2461,6 +2500,7 @@
            class="af_inputListOfValues p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2529,6 +2569,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2592,6 +2633,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2655,6 +2697,7 @@
            class="OraErrorText af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2718,6 +2761,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2781,6 +2825,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2844,6 +2889,7 @@
            class="af_inputListOfValues p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2885,6 +2931,7 @@
            class="af_inputListOfValues"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2948,6 +2995,7 @@
            class="af_inputListOfValues p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputNumberSpinbox-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputNumberSpinbox-minimalScrRdr-golden.xml
index 6ccc7ef..cf75595 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputNumberSpinbox-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputNumberSpinbox-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -29,6 +30,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -120,6 +122,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -143,6 +146,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -235,6 +239,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -258,6 +263,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -350,6 +356,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -373,6 +380,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -465,6 +473,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -488,6 +497,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -580,6 +590,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -603,6 +614,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -695,6 +707,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -718,6 +731,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -810,6 +824,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -833,6 +848,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -925,6 +941,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -948,6 +965,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1040,6 +1058,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1063,6 +1082,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1155,6 +1175,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1178,6 +1199,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1270,6 +1292,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1293,6 +1316,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1385,6 +1409,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1408,6 +1433,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1500,6 +1526,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1523,6 +1550,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1615,6 +1643,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1638,6 +1667,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1730,6 +1760,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1753,6 +1784,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1844,6 +1876,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1872,6 +1905,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -1963,6 +1997,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1986,6 +2021,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -2077,6 +2113,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="id_val__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2100,6 +2137,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -2191,6 +2229,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -2215,6 +2254,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -2306,6 +2346,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2334,6 +2375,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -2425,6 +2467,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -2449,6 +2492,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -2547,6 +2591,7 @@
            class="styleClass_val af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2570,6 +2615,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -2661,6 +2707,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2684,6 +2731,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -2776,6 +2824,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2799,6 +2848,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -2890,6 +2940,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2913,6 +2964,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3010,6 +3062,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3033,6 +3086,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3124,6 +3178,7 @@
            class="af_inputNumberSpinbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3152,6 +3207,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3243,6 +3299,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3266,6 +3323,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3357,6 +3415,7 @@
            class="af_inputNumberSpinbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3385,6 +3444,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3476,6 +3536,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3499,6 +3560,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3590,6 +3652,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3613,6 +3676,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3705,6 +3769,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3728,6 +3793,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3820,6 +3886,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3843,6 +3910,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -3935,6 +4003,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3958,6 +4027,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4050,6 +4120,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4073,6 +4144,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4165,6 +4237,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4188,6 +4261,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4280,6 +4354,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4303,6 +4378,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4395,6 +4471,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4418,6 +4495,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4510,6 +4588,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4533,6 +4612,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4625,6 +4705,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4648,6 +4729,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4740,6 +4822,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4763,6 +4846,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4855,6 +4939,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4878,6 +4963,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -4970,6 +5056,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -4993,6 +5080,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -5085,6 +5173,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -5108,6 +5197,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -5200,6 +5290,7 @@
            class="OraErrorText af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -5223,6 +5314,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -5314,6 +5406,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -5337,6 +5430,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -5428,6 +5522,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -5451,6 +5546,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -5542,6 +5638,7 @@
            class="af_inputNumberSpinbox p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -5565,6 +5662,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -5639,6 +5737,7 @@
            class="af_inputNumberSpinbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -5662,6 +5761,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -5753,6 +5853,7 @@
            class="af_inputNumberSpinbox p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -5791,6 +5892,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -5882,6 +5984,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -5974,6 +6077,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6066,6 +6170,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6158,6 +6263,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6250,6 +6356,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6342,6 +6449,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6434,6 +6542,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6526,6 +6635,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6618,6 +6728,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6710,6 +6821,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6802,6 +6914,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6894,6 +7007,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6986,6 +7100,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7078,6 +7193,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7170,6 +7286,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7261,6 +7378,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7352,6 +7470,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7443,6 +7562,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7517,6 +7637,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputText-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputText-minimalScrRdr-golden.xml
index 348de19..302055d 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputText-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputText-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -46,6 +47,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -87,6 +89,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -128,6 +131,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -169,6 +173,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -210,6 +215,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -251,6 +257,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -292,6 +299,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -333,6 +341,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -374,6 +383,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -415,6 +425,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -456,6 +467,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -497,6 +509,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -538,6 +551,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -579,6 +593,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -620,6 +635,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -660,6 +676,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -705,6 +722,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -745,6 +763,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -786,6 +805,7 @@
            class="af_inputText"
            datatable="0"
            id="id_val__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -826,6 +846,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -867,6 +888,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -912,6 +934,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -960,6 +983,7 @@
            class="styleClass_val af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1000,6 +1024,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1041,6 +1066,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1081,6 +1107,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1122,6 +1149,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -1170,6 +1198,7 @@
            class="af_inputText p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1206,6 +1235,7 @@
            class="af_inputText p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1243,6 +1273,7 @@
            class="af_inputText p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -1281,6 +1312,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1321,6 +1353,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1367,6 +1400,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1407,6 +1441,7 @@
            class="af_inputText p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1452,6 +1487,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1492,6 +1528,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1533,6 +1570,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1573,6 +1611,7 @@
            class="af_inputText p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1618,6 +1657,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1658,6 +1698,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1699,6 +1740,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1740,6 +1782,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1781,6 +1824,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1822,6 +1866,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1863,6 +1908,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1904,6 +1950,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1945,6 +1992,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1986,6 +2034,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2027,6 +2076,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2068,6 +2118,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2109,6 +2160,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2150,6 +2202,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2191,6 +2244,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2232,6 +2286,7 @@
            class="OraErrorText af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2272,6 +2327,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2312,6 +2368,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2352,6 +2409,7 @@
            class="af_inputText p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2393,6 +2451,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2433,6 +2492,7 @@
            class="af_inputText p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputText-rows-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputText-rows-minimalScrRdr-golden.xml
index 71efc02..55e3de3 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputText-rows-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/inputText-rows-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -46,6 +47,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -86,6 +88,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -131,6 +134,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -171,6 +175,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -214,6 +219,7 @@
            class="af_inputText"
            datatable="0"
            id="id_val__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -254,6 +260,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -295,6 +302,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -340,6 +348,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -388,6 +397,7 @@
            class="styleClass_val af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -428,6 +438,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -468,6 +479,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -514,6 +526,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -554,6 +567,7 @@
            class="af_inputText p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -595,6 +609,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -635,6 +650,7 @@
            class="af_inputText p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -675,6 +691,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -716,6 +733,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -757,6 +775,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -798,6 +817,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -838,6 +858,7 @@
            class="af_inputText p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -883,6 +904,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -923,6 +945,7 @@
            class="af_inputText p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -968,6 +991,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1008,6 +1032,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1049,6 +1074,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1090,6 +1116,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1131,6 +1158,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1172,6 +1200,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1213,6 +1242,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1254,6 +1284,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1295,6 +1326,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1336,6 +1368,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1377,6 +1410,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1418,6 +1452,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1459,6 +1494,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1500,6 +1536,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1541,6 +1578,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1582,6 +1620,7 @@
            class="OraErrorText af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1622,6 +1661,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1662,6 +1702,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1702,6 +1743,7 @@
            class="af_inputText p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1743,6 +1785,7 @@
            class="af_inputText"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1783,6 +1826,7 @@
            class="af_inputText p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messages-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messages-minimalScrRdr-golden.xml
index 16a019a..3a7a6a4 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messages-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messages-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -112,6 +113,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -218,6 +220,7 @@
            class="af_messages"
            datatable="0"
            id="id_val"
+           role="presentation"
            summary=""
           >
         
@@ -324,6 +327,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -432,6 +436,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -543,6 +548,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -649,6 +655,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -757,6 +764,7 @@
            class="styleClass_val af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -864,6 +872,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesError-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesError-minimalScrRdr-golden.xml
index 16a019a..3a7a6a4 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesError-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesError-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -112,6 +113,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -218,6 +220,7 @@
            class="af_messages"
            datatable="0"
            id="id_val"
+           role="presentation"
            summary=""
           >
         
@@ -324,6 +327,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -432,6 +436,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -543,6 +548,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -649,6 +655,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -757,6 +764,7 @@
            class="styleClass_val af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -864,6 +872,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesFatal-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesFatal-minimalScrRdr-golden.xml
index 0406a52..abbfb15 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesFatal-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesFatal-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -112,6 +113,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -218,6 +220,7 @@
            class="af_messages"
            datatable="0"
            id="id_val"
+           role="presentation"
            summary=""
           >
         
@@ -324,6 +327,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -432,6 +436,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -543,6 +548,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -649,6 +655,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -757,6 +764,7 @@
            class="styleClass_val af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -864,6 +872,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesInfo-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesInfo-minimalScrRdr-golden.xml
index 609d56f..4cbbaae 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesInfo-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesInfo-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -107,6 +108,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -208,6 +210,7 @@
            class="af_messages"
            datatable="0"
            id="id_val"
+           role="presentation"
            summary=""
           >
         
@@ -309,6 +312,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -412,6 +416,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -518,6 +523,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -619,6 +625,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -722,6 +729,7 @@
            class="styleClass_val af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -824,6 +832,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesWarn-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesWarn-minimalScrRdr-golden.xml
index 2fc8989..b6bc38f 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesWarn-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/messagesWarn-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -107,6 +108,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -208,6 +210,7 @@
            class="af_messages"
            datatable="0"
            id="id_val"
+           role="presentation"
            summary=""
           >
         
@@ -309,6 +312,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -412,6 +416,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -518,6 +523,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -619,6 +625,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="shortDesc_val"
           >
@@ -722,6 +729,7 @@
            class="styleClass_val af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -824,6 +832,7 @@
            class="af_messages"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneBar-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneBar-minimalScrRdr-golden.xml
index bbdd6f2..4b6a91b 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneBar-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneBar-minimalScrRdr-golden.xml
@@ -10,6 +10,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -56,6 +57,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -102,6 +104,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -147,6 +150,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -193,6 +197,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -239,6 +244,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -285,6 +291,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -331,6 +338,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -377,6 +385,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -423,6 +432,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -469,6 +479,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -515,6 +526,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -561,6 +573,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -607,6 +620,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -653,6 +667,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -699,6 +714,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -745,6 +761,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -791,6 +808,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -837,6 +855,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -883,6 +902,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -929,6 +949,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -975,6 +996,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1021,6 +1043,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1067,6 +1090,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1113,6 +1137,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1159,6 +1184,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1205,6 +1231,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1251,6 +1278,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1297,6 +1325,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1343,6 +1372,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1389,6 +1419,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1435,6 +1466,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1481,6 +1513,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1527,6 +1560,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1573,6 +1607,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1619,6 +1654,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1665,6 +1701,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1711,6 +1748,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1757,6 +1795,7 @@
              cellspacing="0"
              class="af_navigationPane_bar-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneButtons-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneButtons-minimalScrRdr-golden.xml
index b68dc0c..fcc14dc 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneButtons-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneButtons-minimalScrRdr-golden.xml
@@ -10,6 +10,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -56,6 +57,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -102,6 +104,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -147,6 +150,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -193,6 +197,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -239,6 +244,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -285,6 +291,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -331,6 +338,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -377,6 +385,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -422,6 +431,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -468,6 +478,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -514,6 +525,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -560,6 +572,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -606,6 +619,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -652,6 +666,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -698,6 +713,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -744,6 +760,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -790,6 +807,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -836,6 +854,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -882,6 +901,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -928,6 +948,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -974,6 +995,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1020,6 +1042,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1066,6 +1089,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1112,6 +1136,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1158,6 +1183,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1204,6 +1230,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1250,6 +1277,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1296,6 +1324,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1342,6 +1371,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1388,6 +1418,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1434,6 +1465,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1480,6 +1512,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1526,6 +1559,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1572,6 +1606,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1618,6 +1653,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1664,6 +1700,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1710,6 +1747,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1756,6 +1794,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1802,6 +1841,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-active-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1848,6 +1888,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1894,6 +1935,7 @@
              cellspacing="0"
              class="af_navigationPane_buttons-inactive-enabled"
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneList-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneList-minimalScrRdr-golden.xml
index 0176b39..2d84101 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneList-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneList-minimalScrRdr-golden.xml
@@ -10,6 +10,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -54,6 +55,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -98,6 +100,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -150,6 +153,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -194,6 +198,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -238,6 +243,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -291,6 +297,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -335,6 +342,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -379,6 +387,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -432,6 +441,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -476,6 +486,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -520,6 +531,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -573,6 +585,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -617,6 +630,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -661,6 +675,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -714,6 +729,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -758,6 +774,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -802,6 +819,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -855,6 +873,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -899,6 +918,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -943,6 +963,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -996,6 +1017,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1040,6 +1062,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1084,6 +1107,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1137,6 +1161,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1181,6 +1206,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1225,6 +1251,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1278,6 +1305,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1322,6 +1350,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1366,6 +1395,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1419,6 +1449,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1463,6 +1494,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1507,6 +1539,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1560,6 +1593,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1604,6 +1638,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1648,6 +1683,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1701,6 +1737,7 @@
              cellspacing="0"
              class="af_navigationPane_list-active-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1745,6 +1782,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1789,6 +1827,7 @@
              cellspacing="0"
              class="af_navigationPane_list-inactive-enabled"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneTabs-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneTabs-minimalScrRdr-golden.xml
index 9cb46d5..c911363 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneTabs-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/navigationPaneTabs-minimalScrRdr-golden.xml
@@ -10,6 +10,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -30,6 +31,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -71,6 +73,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -120,6 +123,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -161,6 +165,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -181,6 +186,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -222,6 +228,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -271,6 +278,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -312,6 +320,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -332,6 +341,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -373,6 +383,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -422,6 +433,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -471,6 +483,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -491,6 +504,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -532,6 +546,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -581,6 +596,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -622,6 +638,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -642,6 +659,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -683,6 +701,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -732,6 +751,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -773,6 +793,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -793,6 +814,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -834,6 +856,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -883,6 +906,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -933,6 +957,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -953,6 +978,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -994,6 +1020,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1043,6 +1070,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1084,6 +1112,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1104,6 +1133,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1145,6 +1175,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1194,6 +1225,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1235,6 +1267,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1255,6 +1288,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1296,6 +1330,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1345,6 +1380,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1395,6 +1431,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1415,6 +1452,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1456,6 +1494,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1505,6 +1544,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1546,6 +1586,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1566,6 +1607,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1607,6 +1649,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1656,6 +1699,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1697,6 +1741,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1717,6 +1762,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1758,6 +1804,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1807,6 +1854,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1857,6 +1905,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -1877,6 +1926,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1918,6 +1968,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -1967,6 +2018,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2008,6 +2060,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -2028,6 +2081,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2069,6 +2123,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2118,6 +2173,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2159,6 +2215,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -2179,6 +2236,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2220,6 +2278,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2269,6 +2328,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2319,6 +2379,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -2339,6 +2400,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2380,6 +2442,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2429,6 +2492,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2470,6 +2534,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -2490,6 +2555,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2531,6 +2597,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2580,6 +2647,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2621,6 +2689,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -2641,6 +2710,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2682,6 +2752,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2731,6 +2802,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2781,6 +2853,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -2801,6 +2874,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2842,6 +2916,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2891,6 +2966,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2932,6 +3008,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -2952,6 +3029,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -2993,6 +3071,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3042,6 +3121,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3083,6 +3163,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -3103,6 +3184,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3144,6 +3226,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3193,6 +3276,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3243,6 +3327,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -3263,6 +3348,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3304,6 +3390,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3353,6 +3440,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3394,6 +3482,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -3414,6 +3503,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3455,6 +3545,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3504,6 +3595,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3545,6 +3637,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -3565,6 +3658,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3606,6 +3700,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3655,6 +3750,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3705,6 +3801,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -3725,6 +3822,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3766,6 +3864,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3815,6 +3914,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3856,6 +3956,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -3876,6 +3977,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3917,6 +4019,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -3966,6 +4069,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4007,6 +4111,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -4027,6 +4132,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4068,6 +4174,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4117,6 +4224,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4167,6 +4275,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -4187,6 +4296,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4228,6 +4338,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4277,6 +4388,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4318,6 +4430,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -4338,6 +4451,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4379,6 +4493,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4428,6 +4543,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4469,6 +4585,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -4489,6 +4606,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4530,6 +4648,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4579,6 +4698,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4629,6 +4749,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -4649,6 +4770,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4690,6 +4812,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4739,6 +4862,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4780,6 +4904,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -4800,6 +4925,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4841,6 +4967,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4890,6 +5017,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4931,6 +5059,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -4951,6 +5080,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -4992,6 +5122,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5041,6 +5172,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5091,6 +5223,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -5111,6 +5244,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5152,6 +5286,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5201,6 +5336,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5242,6 +5378,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -5262,6 +5399,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5303,6 +5441,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5352,6 +5491,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5393,6 +5533,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -5413,6 +5554,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5454,6 +5596,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5503,6 +5646,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5553,6 +5697,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -5573,6 +5718,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5614,6 +5760,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5663,6 +5810,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-active"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5704,6 +5852,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -5724,6 +5873,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5765,6 +5915,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5814,6 +5965,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5855,6 +6007,7 @@
              cellspacing="0"
              class=""
              datatable="0"
+             role="presentation"
              style="display: inline;"
              summary=""
             >
@@ -5875,6 +6028,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5916,6 +6070,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
@@ -5965,6 +6120,7 @@
                      cellspacing="0"
                      class="af_navigationPane_tabs-inactive"
                      datatable="0"
+                     role="presentation"
                      summary=""
                     >
                   
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBorderLayout-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBorderLayout-minimalScrRdr-golden.xml
index eaf78af..e277100 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBorderLayout-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBorderLayout-minimalScrRdr-golden.xml
@@ -5,6 +5,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -222,6 +223,7 @@
            cellspacing="0"
            datatable="0"
            id="test-id"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -439,6 +441,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="test-inlineStyle"
            summary=""
            width="100%"
@@ -659,6 +662,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -876,6 +880,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="test-shortDesc"
            width="100%"
@@ -1095,6 +1100,7 @@
            class="test-styleClass"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -1313,6 +1319,7 @@
            datatable="0"
            id="mainId"
            onclick="test-onclick"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -1531,6 +1538,7 @@
            datatable="0"
            id="mainId"
            ondblclick="test-ondblclick"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -1749,6 +1757,7 @@
            datatable="0"
            id="mainId"
            onkeydown="test-onkeydown"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -1967,6 +1976,7 @@
            datatable="0"
            id="mainId"
            onkeypress="test-onkeypress"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -2185,6 +2195,7 @@
            datatable="0"
            id="mainId"
            onkeyup="test-onkeyup"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -2403,6 +2414,7 @@
            datatable="0"
            id="mainId"
            onmousedown="test-onmousedown"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -2621,6 +2633,7 @@
            datatable="0"
            id="mainId"
            onmousemove="test-onmousemove"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -2839,6 +2852,7 @@
            datatable="0"
            id="mainId"
            onmouseout="test-onmouseout"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -3057,6 +3071,7 @@
            datatable="0"
            id="mainId"
            onmouseover="test-onmouseover"
+           role="presentation"
            summary=""
            width="100%"
           >
@@ -3275,6 +3290,7 @@
            datatable="0"
            id="mainId"
            onmouseup="test-onmouseup"
+           role="presentation"
            summary=""
            width="100%"
           >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalScrRdr-golden.xml
index 057f2e1..fe12f3d 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelBox-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -127,6 +128,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -248,6 +250,7 @@
            class="af_panelBox_medium"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -369,6 +372,7 @@
            class="af_panelBox_dark"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -490,6 +494,7 @@
            class="af_panelBox_transparent"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -611,6 +616,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -653,6 +659,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -765,6 +772,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -807,6 +815,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -913,6 +922,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -1035,6 +1045,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="test-id"
+           role="presentation"
            summary=""
           >
         
@@ -1156,6 +1167,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="test-inlineStyle"
            summary=""
           >
@@ -1280,6 +1292,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -1401,6 +1414,7 @@
            class="af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -1523,6 +1537,7 @@
            class="test-styleClass af_panelBox_light"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -1645,6 +1660,7 @@
            datatable="0"
            id="mainId"
            onclick="test-onclick"
+           role="presentation"
            summary=""
           >
         
@@ -1767,6 +1783,7 @@
            datatable="0"
            id="mainId"
            ondblclick="test-ondblclick"
+           role="presentation"
            summary=""
           >
         
@@ -1889,6 +1906,7 @@
            datatable="0"
            id="mainId"
            onkeydown="test-onkeydown"
+           role="presentation"
            summary=""
           >
         
@@ -2011,6 +2029,7 @@
            datatable="0"
            id="mainId"
            onkeypress="test-onkeypress"
+           role="presentation"
            summary=""
           >
         
@@ -2133,6 +2152,7 @@
            datatable="0"
            id="mainId"
            onkeyup="test-onkeyup"
+           role="presentation"
            summary=""
           >
         
@@ -2255,6 +2275,7 @@
            datatable="0"
            id="mainId"
            onmousedown="test-onmousedown"
+           role="presentation"
            summary=""
           >
         
@@ -2377,6 +2398,7 @@
            datatable="0"
            id="mainId"
            onmousemove="test-onmousemove"
+           role="presentation"
            summary=""
           >
         
@@ -2499,6 +2521,7 @@
            datatable="0"
            id="mainId"
            onmouseout="test-onmouseout"
+           role="presentation"
            summary=""
           >
         
@@ -2621,6 +2644,7 @@
            datatable="0"
            id="mainId"
            onmouseover="test-onmouseover"
+           role="presentation"
            summary=""
           >
         
@@ -2743,6 +2767,7 @@
            datatable="0"
            id="mainId"
            onmouseup="test-onmouseup"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelButtonBar-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelButtonBar-minimalScrRdr-golden.xml
index ca5ae34..8643c18 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelButtonBar-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelButtonBar-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -80,6 +81,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="test-id"
+           role="presentation"
            summary=""
           >
         
@@ -154,6 +156,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="test-inlineStyle"
            summary=""
           >
@@ -231,6 +234,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -305,6 +309,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -380,6 +385,7 @@
            class="test-styleClass af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -454,6 +460,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -533,6 +540,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -607,6 +615,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -681,6 +690,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -761,6 +771,7 @@
            class="af_panelButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -836,6 +847,7 @@
            datatable="0"
            id="mainId"
            onclick="test-onclick"
+           role="presentation"
            summary=""
           >
         
@@ -911,6 +923,7 @@
            datatable="0"
            id="mainId"
            ondblclick="test-ondblclick"
+           role="presentation"
            summary=""
           >
         
@@ -986,6 +999,7 @@
            datatable="0"
            id="mainId"
            onkeydown="test-onkeydown"
+           role="presentation"
            summary=""
           >
         
@@ -1061,6 +1075,7 @@
            datatable="0"
            id="mainId"
            onkeypress="test-onkeypress"
+           role="presentation"
            summary=""
           >
         
@@ -1136,6 +1151,7 @@
            datatable="0"
            id="mainId"
            onkeyup="test-onkeyup"
+           role="presentation"
            summary=""
           >
         
@@ -1211,6 +1227,7 @@
            datatable="0"
            id="mainId"
            onmousedown="test-onmousedown"
+           role="presentation"
            summary=""
           >
         
@@ -1286,6 +1303,7 @@
            datatable="0"
            id="mainId"
            onmousemove="test-onmousemove"
+           role="presentation"
            summary=""
           >
         
@@ -1361,6 +1379,7 @@
            datatable="0"
            id="mainId"
            onmouseout="test-onmouseout"
+           role="presentation"
            summary=""
           >
         
@@ -1436,6 +1455,7 @@
            datatable="0"
            id="mainId"
            onmouseover="test-onmouseover"
+           role="presentation"
            summary=""
           >
         
@@ -1511,6 +1531,7 @@
            datatable="0"
            id="mainId"
            onmouseup="test-onmouseup"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelFormLayout-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelFormLayout-minimalScrRdr-golden.xml
index c5c6683..843abba 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelFormLayout-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelFormLayout-minimalScrRdr-golden.xml
@@ -9,6 +9,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -29,6 +30,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -296,6 +298,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -367,6 +370,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -388,6 +392,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -552,6 +557,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -687,6 +693,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -758,6 +765,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: 100%"
              summary=""
             >
@@ -778,6 +786,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -1047,6 +1056,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -1120,6 +1130,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: 100%"
              summary=""
             >
@@ -1140,6 +1151,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -1409,6 +1421,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -1482,6 +1495,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -1502,6 +1516,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -1769,6 +1784,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -1841,6 +1857,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -1861,6 +1878,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -2128,6 +2146,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -2200,6 +2219,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -2220,6 +2240,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -2487,6 +2508,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -2560,6 +2582,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -2580,6 +2603,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -2847,6 +2871,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -2919,6 +2944,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -2939,6 +2965,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -3206,6 +3233,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -3277,6 +3305,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -3297,6 +3326,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -3564,6 +3594,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -3636,6 +3667,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -3656,6 +3688,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -3923,6 +3956,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -3995,6 +4029,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -4015,6 +4050,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -4282,6 +4318,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -4354,6 +4391,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -4374,6 +4412,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -4641,6 +4680,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -4713,6 +4753,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -4733,6 +4774,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -5000,6 +5042,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -5072,6 +5115,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -5092,6 +5136,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -5359,6 +5404,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -5431,6 +5477,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -5451,6 +5498,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -5718,6 +5766,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -5790,6 +5839,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -5810,6 +5860,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -6077,6 +6128,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -6149,6 +6201,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -6169,6 +6222,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -6436,6 +6490,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -6508,6 +6563,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -6528,6 +6584,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -6795,6 +6852,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -6867,6 +6925,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              style="width: auto"
              summary=""
             >
@@ -6887,6 +6946,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
@@ -7154,6 +7214,7 @@
                      cellpadding="0"
                      cellspacing="0"
                      datatable="0"
+                     role="presentation"
                      summary=""
                      width="100%"
                     >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelGroupLayout-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelGroupLayout-minimalScrRdr-golden.xml
index a532fae..b1551b9 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelGroupLayout-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelGroupLayout-minimalScrRdr-golden.xml
@@ -30,6 +30,7 @@
            class="af_panelGroupLayout"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelHorizontalLayout-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelHorizontalLayout-minimalScrRdr-golden.xml
index 0dc3e18..8b997c0 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelHorizontalLayout-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelHorizontalLayout-minimalScrRdr-golden.xml
@@ -5,6 +5,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -34,6 +35,7 @@
            datatable="0"
            id="mainId"
            onclick="test-onclick"
+           role="presentation"
            summary=""
           >
         
@@ -63,6 +65,7 @@
            datatable="0"
            id="mainId"
            ondblclick="test-ondblclick"
+           role="presentation"
            summary=""
           >
         
@@ -92,6 +95,7 @@
            datatable="0"
            id="mainId"
            onkeydown="test-onkeydown"
+           role="presentation"
            summary=""
           >
         
@@ -121,6 +125,7 @@
            datatable="0"
            id="mainId"
            onkeypress="test-onkeypress"
+           role="presentation"
            summary=""
           >
         
@@ -150,6 +155,7 @@
            datatable="0"
            id="mainId"
            onkeyup="test-onkeyup"
+           role="presentation"
            summary=""
           >
         
@@ -179,6 +185,7 @@
            datatable="0"
            id="mainId"
            onmousedown="test-onmousedown"
+           role="presentation"
            summary=""
           >
         
@@ -208,6 +215,7 @@
            datatable="0"
            id="mainId"
            onmousemove="test-onmousemove"
+           role="presentation"
            summary=""
           >
         
@@ -237,6 +245,7 @@
            datatable="0"
            id="mainId"
            onmouseout="test-onmouseout"
+           role="presentation"
            summary=""
           >
         
@@ -266,6 +275,7 @@
            datatable="0"
            id="mainId"
            onmouseover="test-onmouseover"
+           role="presentation"
            summary=""
           >
         
@@ -295,6 +305,7 @@
            datatable="0"
            id="mainId"
            onmouseup="test-onmouseup"
+           role="presentation"
            summary=""
           >
         
@@ -324,6 +335,7 @@
            class="test-styleClass"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -352,6 +364,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -381,6 +394,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -410,6 +424,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -441,6 +456,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -472,6 +488,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -503,6 +520,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -534,6 +552,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -567,6 +586,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -595,6 +615,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -623,6 +644,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -657,6 +679,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelHorizontalLayout-separator-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelHorizontalLayout-separator-minimalScrRdr-golden.xml
index d7c10ce..5f62f8c 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelHorizontalLayout-separator-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelHorizontalLayout-separator-minimalScrRdr-golden.xml
@@ -5,6 +5,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -52,6 +53,7 @@
            datatable="0"
            id="mainId"
            onclick="test-onclick"
+           role="presentation"
            summary=""
           >
         
@@ -99,6 +101,7 @@
            datatable="0"
            id="mainId"
            ondblclick="test-ondblclick"
+           role="presentation"
            summary=""
           >
         
@@ -146,6 +149,7 @@
            datatable="0"
            id="mainId"
            onkeydown="test-onkeydown"
+           role="presentation"
            summary=""
           >
         
@@ -193,6 +197,7 @@
            datatable="0"
            id="mainId"
            onkeypress="test-onkeypress"
+           role="presentation"
            summary=""
           >
         
@@ -240,6 +245,7 @@
            datatable="0"
            id="mainId"
            onkeyup="test-onkeyup"
+           role="presentation"
            summary=""
           >
         
@@ -287,6 +293,7 @@
            datatable="0"
            id="mainId"
            onmousedown="test-onmousedown"
+           role="presentation"
            summary=""
           >
         
@@ -334,6 +341,7 @@
            datatable="0"
            id="mainId"
            onmousemove="test-onmousemove"
+           role="presentation"
            summary=""
           >
         
@@ -381,6 +389,7 @@
            datatable="0"
            id="mainId"
            onmouseout="test-onmouseout"
+           role="presentation"
            summary=""
           >
         
@@ -428,6 +437,7 @@
            datatable="0"
            id="mainId"
            onmouseover="test-onmouseover"
+           role="presentation"
            summary=""
           >
         
@@ -475,6 +485,7 @@
            datatable="0"
            id="mainId"
            onmouseup="test-onmouseup"
+           role="presentation"
            summary=""
           >
         
@@ -522,6 +533,7 @@
            class="test-styleClass"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -568,6 +580,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -615,6 +628,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -662,6 +676,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -713,6 +728,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -764,6 +780,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -815,6 +832,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -866,6 +884,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -917,6 +936,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -963,6 +983,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -1009,6 +1030,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -1061,6 +1083,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelLabelAndMessage-facet-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelLabelAndMessage-facet-minimalScrRdr-golden.xml
index 20e8f81..cc58e20 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelLabelAndMessage-facet-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelLabelAndMessage-facet-minimalScrRdr-golden.xml
@@ -5,6 +5,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -28,6 +29,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -44,6 +46,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -91,6 +94,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -142,6 +146,7 @@
                        class="af_inputText"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelLabelAndMessage-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelLabelAndMessage-minimalScrRdr-golden.xml
index 9d5abb6..06234ff 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelLabelAndMessage-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelLabelAndMessage-minimalScrRdr-golden.xml
@@ -5,6 +5,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -28,6 +29,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -44,6 +46,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -91,6 +94,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -142,6 +146,7 @@
                        class="af_inputText"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -186,6 +191,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -214,6 +220,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -230,6 +237,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -277,6 +285,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -328,6 +337,7 @@
                        class="af_inputText"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -372,6 +382,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -396,6 +407,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -412,6 +424,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -459,6 +472,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -510,6 +524,7 @@
                        class="af_inputText"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -554,6 +569,7 @@
            cellspacing="0"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -577,6 +593,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -593,6 +610,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -640,6 +658,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -691,6 +710,7 @@
                        class="af_inputText"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -737,6 +757,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -760,6 +781,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -776,6 +798,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -823,6 +846,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -874,6 +898,7 @@
                        class="af_inputText"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -918,6 +943,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -942,6 +968,7 @@
                  cellpadding="0"
                  cellspacing="0"
                  datatable="0"
+                 role="presentation"
                  summary=""
                 >
               
@@ -958,6 +985,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -1005,6 +1033,7 @@
                        class="af_selectBooleanCheckbox"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
@@ -1056,6 +1085,7 @@
                        class="af_inputText"
                        datatable="0"
                        id="_idXXX__xc_"
+                       role="presentation"
                        summary=""
                       >
                     
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelList-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelList-minimalScrRdr-golden.xml
index c0ca006..d9dc35f 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelList-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelList-minimalScrRdr-golden.xml
@@ -101,6 +101,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
              width="100%"
             >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelPage-facets-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelPage-facets-minimalScrRdr-golden.xml
index 073272f..eb7566f 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelPage-facets-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelPage-facets-minimalScrRdr-golden.xml
@@ -77,6 +77,7 @@
                      cellspacing="0"
                      class="af_navigationPane_buttons-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -123,6 +124,7 @@
                      cellspacing="0"
                      class="af_navigationPane_buttons-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -169,6 +171,7 @@
                      cellspacing="0"
                      class="af_navigationPane_buttons-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -221,6 +224,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -241,6 +245,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -282,6 +287,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -331,6 +337,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -372,6 +379,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -392,6 +400,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -433,6 +442,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -482,6 +492,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -523,6 +534,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -543,6 +555,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -584,6 +597,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -633,6 +647,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -701,6 +716,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -747,6 +763,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -793,6 +810,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -901,6 +919,7 @@
                              cellspacing="0"
                              class="af_navigationPane_list-inactive-enabled"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -945,6 +964,7 @@
                              cellspacing="0"
                              class="af_navigationPane_list-inactive-enabled"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -989,6 +1009,7 @@
                              cellspacing="0"
                              class="af_navigationPane_list-inactive-enabled"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1454,6 +1475,7 @@
                      cellspacing="0"
                      class="af_navigationPane_buttons-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1500,6 +1522,7 @@
                      cellspacing="0"
                      class="af_navigationPane_buttons-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1546,6 +1569,7 @@
                      cellspacing="0"
                      class="af_navigationPane_buttons-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1598,6 +1622,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1618,6 +1643,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1659,6 +1685,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1708,6 +1735,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1749,6 +1777,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1769,6 +1798,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1810,6 +1840,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1859,6 +1890,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1900,6 +1932,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1920,6 +1953,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1961,6 +1995,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2010,6 +2045,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2078,6 +2114,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2124,6 +2161,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2170,6 +2208,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2278,6 +2317,7 @@
                              cellspacing="0"
                              class="af_navigationPane_list-inactive-enabled"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2322,6 +2362,7 @@
                              cellspacing="0"
                              class="af_navigationPane_list-inactive-enabled"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2366,6 +2407,7 @@
                              cellspacing="0"
                              class="af_navigationPane_list-inactive-enabled"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelPageHeader-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelPageHeader-minimalScrRdr-golden.xml
index ad12089..d1b015a 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelPageHeader-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/panelPageHeader-minimalScrRdr-golden.xml
@@ -102,6 +102,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -148,6 +149,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -194,6 +196,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -298,6 +301,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -318,6 +322,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -359,6 +364,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -408,6 +414,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -449,6 +456,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -469,6 +477,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -510,6 +519,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -559,6 +569,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -600,6 +611,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -620,6 +632,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -661,6 +674,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -710,6 +724,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -778,6 +793,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -824,6 +840,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -870,6 +887,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1068,6 +1086,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -1114,6 +1133,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -1160,6 +1180,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -1264,6 +1285,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1284,6 +1306,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1325,6 +1348,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1374,6 +1398,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1415,6 +1440,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1435,6 +1461,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1476,6 +1503,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1525,6 +1553,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1566,6 +1595,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1586,6 +1616,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1627,6 +1658,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1676,6 +1708,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -1744,6 +1777,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1790,6 +1824,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -1836,6 +1871,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2035,6 +2071,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -2081,6 +2118,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -2127,6 +2165,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -2231,6 +2270,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2251,6 +2291,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2292,6 +2333,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2341,6 +2383,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2382,6 +2425,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2402,6 +2446,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2443,6 +2488,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2492,6 +2538,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2533,6 +2580,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2553,6 +2601,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2594,6 +2643,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2643,6 +2693,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -2711,6 +2762,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2757,6 +2809,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -2803,6 +2856,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -3002,6 +3056,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -3048,6 +3103,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -3094,6 +3150,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -3198,6 +3255,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -3218,6 +3276,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3259,6 +3318,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3308,6 +3368,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3349,6 +3410,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -3369,6 +3431,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3410,6 +3473,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3459,6 +3523,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3500,6 +3565,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -3520,6 +3586,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3561,6 +3628,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3610,6 +3678,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -3678,6 +3747,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -3724,6 +3794,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -3770,6 +3841,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -3969,6 +4041,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -4015,6 +4088,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -4061,6 +4135,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -4165,6 +4240,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -4185,6 +4261,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4226,6 +4303,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4275,6 +4353,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4316,6 +4395,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -4336,6 +4416,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4377,6 +4458,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4426,6 +4508,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4467,6 +4550,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -4487,6 +4571,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4528,6 +4613,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4577,6 +4663,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -4645,6 +4732,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -4691,6 +4779,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -4737,6 +4826,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -4936,6 +5026,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -4982,6 +5073,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -5028,6 +5120,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -5132,6 +5225,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -5152,6 +5246,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5193,6 +5288,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5242,6 +5338,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5283,6 +5380,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -5303,6 +5401,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5344,6 +5443,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5393,6 +5493,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5434,6 +5535,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -5454,6 +5556,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5495,6 +5598,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5544,6 +5648,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -5612,6 +5717,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -5658,6 +5764,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -5704,6 +5811,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -5903,6 +6011,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -5949,6 +6058,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -5995,6 +6105,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -6099,6 +6210,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -6119,6 +6231,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6160,6 +6273,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6209,6 +6323,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6250,6 +6365,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -6270,6 +6386,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6311,6 +6428,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6360,6 +6478,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6401,6 +6520,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -6421,6 +6541,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6462,6 +6583,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6511,6 +6633,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -6579,6 +6702,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -6625,6 +6749,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -6671,6 +6796,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -6870,6 +6996,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -6916,6 +7043,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -6962,6 +7090,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -7066,6 +7195,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -7086,6 +7216,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7127,6 +7258,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7176,6 +7308,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7217,6 +7350,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -7237,6 +7371,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7278,6 +7413,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7327,6 +7463,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7368,6 +7505,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -7388,6 +7526,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7429,6 +7568,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7478,6 +7618,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -7546,6 +7687,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -7592,6 +7734,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -7638,6 +7781,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -7837,6 +7981,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -7883,6 +8028,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -7929,6 +8075,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -8033,6 +8180,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -8053,6 +8201,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8094,6 +8243,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8143,6 +8293,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8184,6 +8335,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -8204,6 +8356,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8245,6 +8398,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8294,6 +8448,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8335,6 +8490,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -8355,6 +8511,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8396,6 +8553,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8445,6 +8603,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -8513,6 +8672,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -8559,6 +8719,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -8605,6 +8766,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -8804,6 +8966,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -8850,6 +9013,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -8896,6 +9060,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -9000,6 +9165,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -9020,6 +9186,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9061,6 +9228,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9110,6 +9278,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9151,6 +9320,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -9171,6 +9341,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9212,6 +9383,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9261,6 +9433,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9302,6 +9475,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -9322,6 +9496,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9363,6 +9538,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9412,6 +9588,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -9480,6 +9657,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -9526,6 +9704,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -9572,6 +9751,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -9771,6 +9951,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -9817,6 +9998,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -9863,6 +10045,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -9967,6 +10150,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -9987,6 +10171,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10028,6 +10213,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10077,6 +10263,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10118,6 +10305,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -10138,6 +10326,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10179,6 +10368,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10228,6 +10418,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10269,6 +10460,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -10289,6 +10481,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10330,6 +10523,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10379,6 +10573,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10447,6 +10642,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -10493,6 +10689,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -10539,6 +10736,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -10738,6 +10936,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -10784,6 +10983,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -10830,6 +11030,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -10934,6 +11135,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -10954,6 +11156,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -10995,6 +11198,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11044,6 +11248,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11085,6 +11290,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -11105,6 +11311,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11146,6 +11353,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11195,6 +11403,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11236,6 +11445,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -11256,6 +11466,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11297,6 +11508,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11346,6 +11558,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11414,6 +11627,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -11460,6 +11674,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -11506,6 +11721,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -11705,6 +11921,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -11751,6 +11968,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -11797,6 +12015,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -11901,6 +12120,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -11921,6 +12141,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -11962,6 +12183,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12011,6 +12233,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12052,6 +12275,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -12072,6 +12296,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12113,6 +12338,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12162,6 +12388,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12203,6 +12430,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -12223,6 +12451,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12264,6 +12493,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12313,6 +12543,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12381,6 +12612,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -12427,6 +12659,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -12473,6 +12706,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -12672,6 +12906,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -12718,6 +12953,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -12764,6 +13000,7 @@
                            cellspacing="0"
                            class="af_navigationPane_buttons-inactive-enabled"
                            datatable="0"
+                           role="presentation"
                            style="display: inline;"
                            summary=""
                           >
@@ -12868,6 +13105,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -12888,6 +13126,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12929,6 +13168,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -12978,6 +13218,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -13019,6 +13260,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -13039,6 +13281,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -13080,6 +13323,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -13129,6 +13373,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -13170,6 +13415,7 @@
                      cellspacing="0"
                      class=""
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -13190,6 +13436,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -13231,6 +13478,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -13280,6 +13528,7 @@
                              cellspacing="0"
                              class="af_navigationPane_tabs-inactive"
                              datatable="0"
+                             role="presentation"
                              summary=""
                             >
                           
@@ -13348,6 +13597,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -13394,6 +13644,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
@@ -13440,6 +13691,7 @@
                      cellspacing="0"
                      class="af_navigationPane_bar-inactive-enabled"
                      datatable="0"
+                     role="presentation"
                      style="display: inline;"
                      summary=""
                     >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/rowLayout-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/rowLayout-minimalScrRdr-golden.xml
index 735fa66..af03279 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/rowLayout-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/rowLayout-minimalScrRdr-golden.xml
@@ -5,6 +5,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -31,6 +32,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -57,6 +59,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -83,6 +86,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -109,6 +113,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -135,6 +140,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -160,6 +166,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            valign="middle"
           >
@@ -186,6 +193,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            valign="top"
           >
@@ -212,6 +220,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            valign="bottom"
           >
@@ -238,6 +247,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="75%"
           >
@@ -264,6 +274,7 @@
            cellspacing="0"
            datatable="0"
            id="myRowId"
+           role="presentation"
            summary=""
           >
         
@@ -289,6 +300,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:blue"
            summary=""
           >
@@ -315,6 +327,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="myShortDesc"
           >
@@ -342,6 +355,7 @@
            class="myStyle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -368,6 +382,7 @@
            datatable="0"
            id="mainId"
            onclick="test-onclick"
+           role="presentation"
            summary=""
           >
         
@@ -394,6 +409,7 @@
            datatable="0"
            id="mainId"
            ondblclick="test-ondblclick"
+           role="presentation"
            summary=""
           >
         
@@ -420,6 +436,7 @@
            datatable="0"
            id="mainId"
            onkeydown="test-onkeydown"
+           role="presentation"
            summary=""
           >
         
@@ -446,6 +463,7 @@
            datatable="0"
            id="mainId"
            onkeypress="test-onkeypress"
+           role="presentation"
            summary=""
           >
         
@@ -472,6 +490,7 @@
            datatable="0"
            id="mainId"
            onkeyup="test-onkeyup"
+           role="presentation"
            summary=""
           >
         
@@ -498,6 +517,7 @@
            datatable="0"
            id="mainId"
            onmousedown="test-onmousedown"
+           role="presentation"
            summary=""
           >
         
@@ -524,6 +544,7 @@
            datatable="0"
            id="mainId"
            onmousemove="test-onmousemove"
+           role="presentation"
            summary=""
           >
         
@@ -550,6 +571,7 @@
            datatable="0"
            id="mainId"
            onmouseout="test-onmouseout"
+           role="presentation"
            summary=""
           >
         
@@ -576,6 +598,7 @@
            datatable="0"
            id="mainId"
            onmouseover="test-onmouseover"
+           role="presentation"
            summary=""
           >
         
@@ -602,6 +625,7 @@
            datatable="0"
            id="mainId"
            onmouseup="test-onmouseup"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectBooleanCheckbox-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectBooleanCheckbox-minimalScrRdr-golden.xml
index 25258d0..d14210d 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectBooleanCheckbox-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectBooleanCheckbox-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -50,6 +51,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -94,6 +96,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -138,6 +141,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -188,6 +192,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -233,6 +238,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -277,6 +283,7 @@
            class="af_selectBooleanCheckbox p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -322,6 +329,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -371,6 +379,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -415,6 +424,7 @@
            class="af_selectBooleanCheckbox p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -461,6 +471,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -505,6 +516,7 @@
            class="af_selectBooleanCheckbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -554,6 +566,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -598,6 +611,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -643,6 +657,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -692,6 +707,7 @@
            class="test-styleClass af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="color:red"
            summary=""
           >
@@ -742,6 +758,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -786,6 +803,7 @@
            class="af_selectBooleanCheckbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -835,6 +853,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -879,6 +898,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -931,6 +951,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -976,6 +997,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1021,6 +1043,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1066,6 +1089,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1111,6 +1135,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1156,6 +1181,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1201,6 +1227,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1246,6 +1273,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1291,6 +1319,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1336,6 +1365,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1381,6 +1411,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1426,6 +1457,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1471,6 +1503,7 @@
            class="af_selectBooleanCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectBooleanRadio-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectBooleanRadio-minimalScrRdr-golden.xml
index 71de638..d6be350 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectBooleanRadio-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectBooleanRadio-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -50,6 +51,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -94,6 +96,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -144,6 +147,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -189,6 +193,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -233,6 +238,7 @@
            class="af_selectBooleanRadio p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -278,6 +284,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -327,6 +334,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -371,6 +379,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -415,6 +424,7 @@
            class="af_selectBooleanRadio p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -461,6 +471,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -505,6 +516,7 @@
            class="af_selectBooleanRadio p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -554,6 +566,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -598,6 +611,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -643,6 +657,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -692,6 +707,7 @@
            class="test-styleClass af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="color:red"
            summary=""
           >
@@ -742,6 +758,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -786,6 +803,7 @@
            class="af_selectBooleanRadio p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -835,6 +853,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -879,6 +898,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -931,6 +951,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -976,6 +997,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1021,6 +1043,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1066,6 +1089,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1111,6 +1135,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1156,6 +1181,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1201,6 +1227,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1246,6 +1273,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1291,6 +1319,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1336,6 +1365,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1381,6 +1411,7 @@
            class="af_selectBooleanRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyCheckbox-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyCheckbox-minimalScrRdr-golden.xml
index 5ab4163..d6c0b8d 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyCheckbox-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyCheckbox-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -90,6 +91,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -175,6 +177,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -216,6 +219,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -300,6 +304,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -384,6 +389,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -459,6 +465,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -543,6 +550,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -627,6 +635,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -719,6 +728,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -803,6 +813,7 @@
            class="af_selectManyCheckbox p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -891,6 +902,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -975,6 +987,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1059,6 +1072,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1143,6 +1157,7 @@
            class="af_selectManyCheckbox p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1180,6 +1195,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1264,6 +1280,7 @@
            class="af_selectManyCheckbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1353,6 +1370,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1437,6 +1455,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1521,6 +1540,7 @@
            class="af_selectManyCheckbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1610,6 +1630,7 @@
            class="af_selectManyCheckbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1699,6 +1720,7 @@
            class="af_selectManyCheckbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1788,6 +1810,7 @@
            class="af_selectManyCheckbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1877,6 +1900,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1961,6 +1985,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -2046,6 +2071,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -2142,6 +2168,7 @@
            class="test-styleClass af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2226,6 +2253,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2313,6 +2341,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2400,6 +2429,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2487,6 +2517,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2572,6 +2603,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2659,6 +2691,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2744,6 +2777,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2829,6 +2863,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2914,6 +2949,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2999,6 +3035,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3084,6 +3121,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3169,6 +3207,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3254,6 +3293,7 @@
            class="af_selectManyCheckbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyListBox-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyListBox-minimalScrRdr-golden.xml
index 08d6cf9..9c1b0d6 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyListBox-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyListBox-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -61,6 +62,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -117,6 +119,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -172,6 +175,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -227,6 +231,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -282,6 +287,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -343,6 +349,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -398,6 +405,7 @@
            class="af_selectManyListbox p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -454,6 +462,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -514,6 +523,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -569,6 +579,7 @@
            class="af_selectManyListbox p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -606,6 +617,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -661,6 +673,7 @@
            class="af_selectManyListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -721,6 +734,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -776,6 +790,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -831,6 +846,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -886,6 +902,7 @@
            class="af_selectManyListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -946,6 +963,7 @@
            class="af_selectManyListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1006,6 +1024,7 @@
            class="af_selectManyListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1066,6 +1085,7 @@
            class="af_selectManyListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1126,6 +1146,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1181,6 +1202,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -1237,6 +1259,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -1300,6 +1323,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1356,6 +1380,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1412,6 +1437,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1468,6 +1494,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1524,6 +1551,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1580,6 +1608,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1636,6 +1665,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1692,6 +1722,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1748,6 +1779,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1804,6 +1836,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1860,6 +1893,7 @@
            class="af_selectManyListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyShuttle-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyShuttle-minimalScrRdr-golden.xml
index 40eba16..d5cfa05 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyShuttle-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectManyShuttle-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -42,6 +43,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -88,6 +90,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -329,6 +332,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -375,6 +379,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -521,6 +526,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -557,6 +563,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -603,6 +610,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -844,6 +852,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -890,6 +899,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -1036,6 +1046,7 @@
            class="af_selectManyShuttle p_AFDisabled"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -1072,6 +1083,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -1118,6 +1130,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -1352,6 +1365,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -1398,6 +1412,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -1545,6 +1560,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -1581,6 +1597,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -1627,6 +1644,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -1868,6 +1886,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -1914,6 +1933,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -2060,6 +2080,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -2096,6 +2117,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -2142,6 +2164,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -2454,6 +2477,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -2500,6 +2524,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -2716,6 +2741,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -2752,6 +2778,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -2798,6 +2825,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -3046,6 +3074,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -3092,6 +3121,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -3238,6 +3268,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -3274,6 +3305,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -3320,6 +3352,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -3561,6 +3594,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -3607,6 +3641,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -3753,6 +3788,7 @@
            class="af_selectManyShuttle p_AFReadOnly"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -3789,6 +3825,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -3835,6 +3872,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -4069,6 +4107,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -4115,6 +4154,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -4262,6 +4302,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -4298,6 +4339,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -4344,6 +4386,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -4585,6 +4628,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -4631,6 +4675,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -4777,6 +4822,7 @@
            class="af_selectManyShuttle p_AFRequired"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -4826,6 +4872,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -4872,6 +4919,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -5113,6 +5161,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -5159,6 +5208,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -5305,6 +5355,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -5341,6 +5392,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -5387,6 +5439,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -5628,6 +5681,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -5674,6 +5728,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -5820,6 +5875,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -5856,6 +5912,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -5902,6 +5959,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -6143,6 +6201,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -6189,6 +6248,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -6335,6 +6395,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -6371,6 +6432,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -6417,6 +6479,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -6728,6 +6791,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -6774,6 +6838,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -6991,6 +7056,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -7027,6 +7093,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -7073,6 +7140,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -7314,6 +7382,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -7360,6 +7429,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -7513,6 +7583,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="test-id"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -7549,6 +7620,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -7595,6 +7667,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -7836,6 +7909,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -7882,6 +7956,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -8028,6 +8103,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            style="background-color:red"
            summary=""
            width="10%"
@@ -8065,6 +8141,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -8111,6 +8188,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -8352,6 +8430,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -8398,6 +8477,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -8544,6 +8624,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="test-shortDesc"
            width="10%"
@@ -8581,6 +8662,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -8627,6 +8709,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -8868,6 +8951,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -8914,6 +8998,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -9066,6 +9151,7 @@
            class="test-styleClass af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -9102,6 +9188,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -9148,6 +9235,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -9389,6 +9477,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -9435,6 +9524,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -9582,6 +9672,7 @@
            datatable="0"
            id="mainId"
            onblur="test-onblur"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -9618,6 +9709,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -9664,6 +9756,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -9906,6 +9999,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -9952,6 +10046,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -10100,6 +10195,7 @@
            datatable="0"
            id="mainId"
            onchange="test-onchange"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -10136,6 +10232,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -10182,6 +10279,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -10423,6 +10521,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -10469,6 +10568,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -10616,6 +10716,7 @@
            datatable="0"
            id="mainId"
            onclick="test-onclick"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -10653,6 +10754,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onclick="test-onclick"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -10699,6 +10801,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -10942,6 +11045,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onclick="test-onclick"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -10988,6 +11092,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -11136,6 +11241,7 @@
            datatable="0"
            id="mainId"
            ondblclick="test-ondblclick"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -11173,6 +11279,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  ondblclick="test-ondblclick"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -11219,6 +11326,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -11461,6 +11569,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  ondblclick="test-ondblclick"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -11507,6 +11616,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -11654,6 +11764,7 @@
            datatable="0"
            id="mainId"
            onfocus="test-onfocus"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -11690,6 +11801,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -11736,6 +11848,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -11978,6 +12091,7 @@
                  cellspacing="0"
                  class="af_selectManyShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -12024,6 +12138,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -12172,6 +12287,7 @@
            datatable="0"
            id="mainId"
            onkeydown="test-onkeydown"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -12209,6 +12325,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onkeydown="test-onkeydown"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -12255,6 +12372,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -12498,6 +12616,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onkeydown="test-onkeydown"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -12544,6 +12663,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -12692,6 +12812,7 @@
            datatable="0"
            id="mainId"
            onkeypress="test-onkeypress"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -12729,6 +12850,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onkeypress="test-onkeypress"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -12775,6 +12897,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -13018,6 +13141,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onkeypress="test-onkeypress"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -13064,6 +13188,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -13212,6 +13337,7 @@
            datatable="0"
            id="mainId"
            onkeyup="test-onkeyup"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -13249,6 +13375,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onkeyup="test-onkeyup"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -13295,6 +13422,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -13538,6 +13666,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onkeyup="test-onkeyup"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -13584,6 +13713,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -13732,6 +13862,7 @@
            datatable="0"
            id="mainId"
            onmousedown="test-onmousedown"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -13769,6 +13900,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmousedown="test-onmousedown"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -13815,6 +13947,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -14058,6 +14191,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmousedown="test-onmousedown"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -14104,6 +14238,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -14252,6 +14387,7 @@
            datatable="0"
            id="mainId"
            onmousemove="test-onmousemove"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -14289,6 +14425,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmousemove="test-onmousemove"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -14335,6 +14472,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -14578,6 +14716,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmousemove="test-onmousemove"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -14624,6 +14763,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -14772,6 +14912,7 @@
            datatable="0"
            id="mainId"
            onmouseout="test-onmouseout"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -14809,6 +14950,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmouseout="test-onmouseout"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -14855,6 +14997,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -15098,6 +15241,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmouseout="test-onmouseout"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -15144,6 +15288,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -15292,6 +15437,7 @@
            datatable="0"
            id="mainId"
            onmouseover="test-onmouseover"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -15329,6 +15475,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmouseover="test-onmouseover"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -15375,6 +15522,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -15618,6 +15766,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmouseover="test-onmouseover"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -15664,6 +15813,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -15812,6 +15962,7 @@
            datatable="0"
            id="mainId"
            onmouseup="test-onmouseup"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -15849,6 +16000,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmouseup="test-onmouseup"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -15895,6 +16047,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -16138,6 +16291,7 @@
                  class="af_selectManyShuttle_box"
                  datatable="0"
                  onmouseup="test-onmouseup"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -16184,6 +16338,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneChoice-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneChoice-minimalScrRdr-golden.xml
index ecca45d..61eb4cf 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneChoice-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneChoice-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -63,6 +64,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -116,6 +118,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -173,6 +176,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -230,6 +234,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -287,6 +292,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -350,6 +356,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -407,6 +414,7 @@
            class="af_selectOneChoice p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -465,6 +473,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -527,6 +536,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -584,6 +594,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -641,6 +652,7 @@
            class="af_selectOneChoice p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -677,6 +689,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -734,6 +747,7 @@
            class="af_selectOneChoice p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -796,6 +810,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -853,6 +868,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -910,6 +926,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -967,6 +984,7 @@
            class="af_selectOneChoice p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1029,6 +1047,7 @@
            class="af_selectOneChoice p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1091,6 +1110,7 @@
            class="af_selectOneChoice p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1153,6 +1173,7 @@
            class="af_selectOneChoice p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1215,6 +1236,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -1273,6 +1295,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -1338,6 +1361,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1396,6 +1420,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1454,6 +1479,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1512,6 +1538,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1570,6 +1597,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1628,6 +1656,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1686,6 +1715,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1744,6 +1774,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1802,6 +1833,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1860,6 +1892,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1918,6 +1951,7 @@
            class="af_selectOneChoice"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneListbox-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneListbox-minimalScrRdr-golden.xml
index d7c5789..230b957 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneListbox-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneListbox-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -60,6 +61,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -115,6 +117,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -169,6 +172,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -223,6 +227,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -277,6 +282,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -337,6 +343,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -391,6 +398,7 @@
            class="af_selectOneListbox p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -446,6 +454,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -505,6 +514,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -565,6 +575,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -619,6 +630,7 @@
            class="af_selectOneListbox p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -656,6 +668,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -710,6 +723,7 @@
            class="af_selectOneListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -769,6 +783,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -823,6 +838,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -877,6 +893,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -931,6 +948,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -985,6 +1003,7 @@
            class="af_selectOneListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1044,6 +1063,7 @@
            class="af_selectOneListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1103,6 +1123,7 @@
            class="af_selectOneListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1162,6 +1183,7 @@
            class="af_selectOneListbox p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1221,6 +1243,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -1276,6 +1299,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -1338,6 +1362,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1393,6 +1418,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1448,6 +1474,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1503,6 +1530,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1558,6 +1586,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1613,6 +1642,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1668,6 +1698,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1723,6 +1754,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1778,6 +1810,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1833,6 +1866,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1888,6 +1922,7 @@
            class="af_selectOneListbox"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneRadio-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneRadio-minimalScrRdr-golden.xml
index c3c6445..24e2e5a 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneRadio-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOneRadio-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -90,6 +91,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -175,6 +177,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -259,6 +262,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -343,6 +347,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -427,6 +432,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -519,6 +525,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -603,6 +610,7 @@
            class="af_selectOneRadio p_AFDisabled"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -691,6 +699,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -775,6 +784,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -877,6 +887,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -961,6 +972,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1036,6 +1048,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1120,6 +1133,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1204,6 +1218,7 @@
            class="af_selectOneRadio p_AFReadOnly"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1241,6 +1256,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1325,6 +1341,7 @@
            class="af_selectOneRadio p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1414,6 +1431,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="test-id__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1498,6 +1516,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1582,6 +1601,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1666,6 +1686,7 @@
            class="af_selectOneRadio p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1755,6 +1776,7 @@
            class="af_selectOneRadio p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1844,6 +1866,7 @@
            class="af_selectOneRadio p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -1933,6 +1956,7 @@
            class="af_selectOneRadio p_AFRequired"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2022,6 +2046,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            style="background-color:red"
            summary=""
           >
@@ -2107,6 +2132,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
@@ -2203,6 +2229,7 @@
            class="test-styleClass af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2287,6 +2314,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2374,6 +2402,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2461,6 +2490,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2548,6 +2578,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2633,6 +2664,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2720,6 +2752,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2805,6 +2838,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2890,6 +2924,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -2975,6 +3010,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3060,6 +3096,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3145,6 +3182,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3230,6 +3268,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
@@ -3315,6 +3354,7 @@
            class="af_selectOneRadio"
            datatable="0"
            id="mainId__xc_"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOrderShuttle-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOrderShuttle-minimalScrRdr-golden.xml
index ca4d3be..5dcb789 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOrderShuttle-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectOrderShuttle-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -42,6 +43,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -88,6 +90,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -329,6 +332,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -375,6 +379,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -571,6 +576,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -607,6 +613,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -653,6 +660,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -894,6 +902,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -940,6 +949,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -1136,6 +1146,7 @@
            class="af_selectManyShuttle p_AFDisabled"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -1172,6 +1183,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -1218,6 +1230,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -1452,6 +1465,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -1498,6 +1512,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -1691,6 +1706,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -1727,6 +1743,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -1773,6 +1790,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -2014,6 +2032,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -2060,6 +2079,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -2256,6 +2276,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -2292,6 +2313,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -2338,6 +2360,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -2650,6 +2673,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -2696,6 +2720,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -2962,6 +2987,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -2998,6 +3024,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -3044,6 +3071,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -3292,6 +3320,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -3338,6 +3367,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -3534,6 +3564,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -3570,6 +3601,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -3616,6 +3648,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -3857,6 +3890,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -3903,6 +3937,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -4099,6 +4134,7 @@
            class="af_selectManyShuttle p_AFReadOnly"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -4135,6 +4171,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -4181,6 +4218,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -4415,6 +4453,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -4461,6 +4500,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -4654,6 +4694,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -4690,6 +4731,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -4736,6 +4778,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -4977,6 +5020,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -5023,6 +5067,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -5219,6 +5264,7 @@
            class="af_selectManyShuttle p_AFRequired"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -5268,6 +5314,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -5314,6 +5361,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -5555,6 +5603,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -5601,6 +5650,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -5797,6 +5847,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -5833,6 +5884,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -5879,6 +5931,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -6120,6 +6173,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -6166,6 +6220,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -6362,6 +6417,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -6398,6 +6454,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -6444,6 +6501,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -6685,6 +6743,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -6731,6 +6790,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -6927,6 +6987,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -6963,6 +7024,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -7009,6 +7071,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -7320,6 +7383,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -7366,6 +7430,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -7633,6 +7698,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -7669,6 +7735,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -7715,6 +7782,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -7956,6 +8024,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -8002,6 +8071,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -8205,6 +8275,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="test-id"
+           role="presentation"
            summary=""
            width="10%"
           >
@@ -8241,6 +8312,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -8287,6 +8359,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -8528,6 +8601,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -8574,6 +8648,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -8770,6 +8845,7 @@
            class="af_selectManyShuttle"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="test-shortDesc"
            width="10%"
@@ -8807,6 +8883,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -8853,6 +8930,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
@@ -9094,6 +9172,7 @@
                  cellspacing="0"
                  class="af_selectOrderShuttle_box"
                  datatable="0"
+                 role="presentation"
                  style="width:100%"
                  summary=""
                 >
@@ -9140,6 +9219,7 @@
                            border="0"
                            cellpadding="0"
                            datatable="0"
+                           role="presentation"
                            summary=""
                           >
                         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectRangeChoiceBar-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectRangeChoiceBar-minimalScrRdr-golden.xml
index defa1b2..d569216 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectRangeChoiceBar-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectRangeChoiceBar-minimalScrRdr-golden.xml
@@ -5,6 +5,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -88,6 +89,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -194,6 +196,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -262,6 +265,7 @@
            cellspacing="0"
            datatable="0"
            id="test-id"
+           role="presentation"
            summary=""
           >
         
@@ -335,6 +339,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="test-shortDesc"
           >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectRangeChoiceBarBig-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectRangeChoiceBarBig-minimalScrRdr-golden.xml
index b3cf482..8bc138b 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectRangeChoiceBarBig-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/selectRangeChoiceBarBig-minimalScrRdr-golden.xml
@@ -5,6 +5,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -246,6 +247,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -487,6 +489,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -730,6 +733,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -973,6 +977,7 @@
            cellspacing="0"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/singleStepButtonBar-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/singleStepButtonBar-minimalScrRdr-golden.xml
index c919329..a83077b 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/singleStepButtonBar-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/singleStepButtonBar-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_singleStepButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -53,6 +54,7 @@
            class="af_singleStepButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -105,6 +107,7 @@
            class="af_singleStepButtonBar"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -177,6 +180,7 @@
            class="af_singleStepButtonBar"
            datatable="0"
            id="test-id"
+           role="presentation"
            summary=""
           >
         
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/table-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/table-minimalScrRdr-golden.xml
index 4f34d33..dcc1b44 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/table-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/table-minimalScrRdr-golden.xml
@@ -9,6 +9,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -24,6 +25,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -47,6 +49,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -474,6 +477,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -489,6 +493,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -512,6 +517,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -939,6 +945,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -954,6 +961,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -977,6 +985,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -1405,6 +1414,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1420,6 +1430,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -1443,6 +1454,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -1910,6 +1922,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1925,6 +1938,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -1948,6 +1962,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -2375,6 +2390,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -2390,6 +2406,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -2413,6 +2430,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -2840,6 +2858,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -2855,6 +2874,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -2878,6 +2898,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -3310,6 +3331,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -3325,6 +3347,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -3348,6 +3371,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -3775,6 +3799,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -3790,6 +3815,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -3813,6 +3839,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -3928,6 +3955,7 @@
                    cellspacing="0"
                    class="af_table_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -4285,6 +4313,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -4300,6 +4329,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -4323,6 +4353,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -4850,6 +4881,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -4865,6 +4897,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -4888,6 +4921,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -5315,6 +5349,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -5330,6 +5365,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -5353,6 +5389,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -5780,6 +5817,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -5795,6 +5833,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -5818,6 +5857,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -6245,6 +6285,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6260,6 +6301,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -6283,6 +6325,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -6710,6 +6753,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6725,6 +6769,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -6748,6 +6793,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -7175,6 +7221,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7190,6 +7237,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -7213,6 +7261,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -7640,6 +7689,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7655,6 +7705,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -7678,6 +7729,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -8106,6 +8158,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
              width="70%"
             >
@@ -8122,6 +8175,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -8145,6 +8199,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -8572,6 +8627,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -8587,6 +8643,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -8610,6 +8667,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -9045,6 +9103,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -9060,6 +9119,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -9083,6 +9143,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml
index a55056d..6ec32c2 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectMany-minimalScrRdr-golden.xml
@@ -9,6 +9,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -24,6 +25,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -47,6 +49,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -162,6 +165,7 @@
                    cellspacing="0"
                    class="af_table_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -362,6 +366,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -377,6 +382,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -400,6 +406,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -515,6 +522,7 @@
                    cellspacing="0"
                    class="af_table_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -715,6 +723,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -730,6 +739,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -753,6 +763,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -868,6 +879,7 @@
                    cellspacing="0"
                    class="af_table_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectOne-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectOne-minimalScrRdr-golden.xml
index 6698322..99ea08a 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectOne-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/tableSelectOne-minimalScrRdr-golden.xml
@@ -9,6 +9,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -24,6 +25,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -47,6 +49,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -298,6 +301,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -313,6 +317,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -336,6 +341,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -587,6 +593,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -602,6 +609,7 @@
                    cellspacing="0"
                    class="af_table_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -625,6 +633,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/train-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/train-minimalScrRdr-golden.xml
index 873d2eb..e9887bf 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/train-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/train-minimalScrRdr-golden.xml
@@ -6,6 +6,7 @@
            class="af_train"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -28,6 +29,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -77,6 +79,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -126,6 +129,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -213,6 +217,7 @@
            class="af_train"
            datatable="0"
            id="myid"
+           role="presentation"
            summary=""
           >
         
@@ -235,6 +240,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -284,6 +290,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -333,6 +340,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -420,6 +428,7 @@
            class="af_train"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
            title="my short desc"
           >
@@ -443,6 +452,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -492,6 +502,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -541,6 +552,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -628,6 +640,7 @@
            class="mystyle af_train"
            datatable="0"
            id="mainId"
+           role="presentation"
            summary=""
           >
         
@@ -650,6 +663,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -699,6 +713,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -748,6 +763,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -836,6 +852,7 @@
            datatable="0"
            id="mainId"
            onclick="test-onclick"
+           role="presentation"
            summary=""
           >
         
@@ -858,6 +875,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -907,6 +925,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -956,6 +975,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1044,6 +1064,7 @@
            datatable="0"
            id="mainId"
            ondblclick="test-ondblclick"
+           role="presentation"
            summary=""
           >
         
@@ -1066,6 +1087,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1115,6 +1137,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1164,6 +1187,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1252,6 +1276,7 @@
            datatable="0"
            id="mainId"
            onkeydown="test-onkeydown"
+           role="presentation"
            summary=""
           >
         
@@ -1274,6 +1299,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1323,6 +1349,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1372,6 +1399,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1460,6 +1488,7 @@
            datatable="0"
            id="mainId"
            onkeypress="test-onkeypress"
+           role="presentation"
            summary=""
           >
         
@@ -1482,6 +1511,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1531,6 +1561,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1580,6 +1611,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1668,6 +1700,7 @@
            datatable="0"
            id="mainId"
            onkeyup="test-onkeyup"
+           role="presentation"
            summary=""
           >
         
@@ -1690,6 +1723,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1739,6 +1773,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1788,6 +1823,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1876,6 +1912,7 @@
            datatable="0"
            id="mainId"
            onmousedown="test-onmousedown"
+           role="presentation"
            summary=""
           >
         
@@ -1898,6 +1935,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1947,6 +1985,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -1996,6 +2035,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2084,6 +2124,7 @@
            datatable="0"
            id="mainId"
            onmousemove="test-onmousemove"
+           role="presentation"
            summary=""
           >
         
@@ -2106,6 +2147,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2155,6 +2197,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2204,6 +2247,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2292,6 +2336,7 @@
            datatable="0"
            id="mainId"
            onmouseout="test-onmouseout"
+           role="presentation"
            summary=""
           >
         
@@ -2314,6 +2359,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2363,6 +2409,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2412,6 +2459,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2500,6 +2548,7 @@
            datatable="0"
            id="mainId"
            onmouseover="test-onmouseover"
+           role="presentation"
            summary=""
           >
         
@@ -2522,6 +2571,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2571,6 +2621,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2620,6 +2671,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2708,6 +2760,7 @@
            datatable="0"
            id="mainId"
            onmouseup="test-onmouseup"
+           role="presentation"
            summary=""
           >
         
@@ -2730,6 +2783,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2779,6 +2833,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
@@ -2828,6 +2883,7 @@
                    cellpadding="0"
                    cellspacing="0"
                    datatable="0"
+                   role="presentation"
                    style="width: 100%"
                    summary=""
                   >
diff --git a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/treeTable-minimalScrRdr-golden.xml b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/treeTable-minimalScrRdr-golden.xml
index d6b8a81..b27a29f 100644
--- a/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/treeTable-minimalScrRdr-golden.xml
+++ b/trinidad-impl/src/test/resources/org/apache/myfaces/trinidadinternal/renderkit/golden/treeTable-minimalScrRdr-golden.xml
@@ -8,6 +8,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -23,6 +24,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -46,6 +48,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -156,6 +159,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -464,6 +468,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -479,6 +484,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -502,6 +508,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -612,6 +619,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -920,6 +928,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -935,6 +944,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -958,6 +968,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -1068,6 +1079,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -1376,6 +1388,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1391,6 +1404,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -1414,6 +1428,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -1524,6 +1539,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -1832,6 +1848,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -1847,6 +1864,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -1870,6 +1888,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="test-id-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -1980,6 +1999,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -2289,6 +2309,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -2304,6 +2325,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -2327,6 +2349,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -2437,6 +2460,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -2746,6 +2770,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -2761,6 +2786,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -2784,6 +2810,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -2894,6 +2921,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -3202,6 +3230,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -3217,6 +3246,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -3240,6 +3270,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -3350,6 +3381,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -3658,6 +3690,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -3673,6 +3706,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -3696,6 +3730,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -3806,6 +3841,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -4146,6 +4182,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -4161,6 +4198,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -4184,6 +4222,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -4294,6 +4333,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -4634,6 +4674,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -4649,6 +4690,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -4672,6 +4714,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -5045,6 +5088,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -5060,6 +5104,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -5083,6 +5128,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -5193,6 +5239,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -5502,6 +5549,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -5517,6 +5565,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -5540,6 +5589,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -5650,6 +5700,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -5959,6 +6010,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -5974,6 +6026,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -5997,6 +6050,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -6107,6 +6161,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -6416,6 +6471,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6431,6 +6487,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -6454,6 +6511,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -6564,6 +6622,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -6873,6 +6932,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -6888,6 +6948,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -6911,6 +6972,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -7021,6 +7083,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -7330,6 +7393,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7345,6 +7409,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -7368,6 +7433,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -7478,6 +7544,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -7787,6 +7854,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -7802,6 +7870,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -7825,6 +7894,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -7935,6 +8005,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -8244,6 +8315,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -8259,6 +8331,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -8282,6 +8355,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -8392,6 +8466,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -8701,6 +8776,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -8716,6 +8792,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -8739,6 +8816,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -8849,6 +8927,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -9158,6 +9237,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -9173,6 +9253,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -9196,6 +9277,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -9306,6 +9388,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -9615,6 +9698,7 @@
              cellpadding="0"
              cellspacing="0"
              datatable="0"
+             role="presentation"
              summary=""
             >
           
@@ -9630,6 +9714,7 @@
                    cellspacing="0"
                    class="af_treeTable_control-bar-top"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >
@@ -9653,6 +9738,7 @@
                          cellspacing="0"
                          datatable="0"
                          id="mainId-nb"
+                         role="presentation"
                          summary=""
                         >
                       
@@ -9763,6 +9849,7 @@
                    cellspacing="0"
                    class="af_treeTable_sub-control-bar"
                    datatable="0"
+                   role="presentation"
                    summary=""
                    width="100%"
                   >

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 25/36: The default for clientId caching was accidentally true. Argh!! Fix case where the component is moved between NamingContainers and therefore needs to clear the cached clientIds

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 42b48e360cd373aaa49ba1c4ea370685a4211374
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Tue Mar 2 03:34:30 2010 +0000

    The default for clientId caching was accidentally true.  Argh!! Fix case where the component is moved between NamingContainers and therefore needs to clear the cached clientIds
---
 .../trinidad/component/UIXComponentBase.java       | 24 +++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
index bf57526..ff71c3f 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
@@ -488,7 +488,25 @@ abstract public class UIXComponentBase extends UIXComponent
   @Override
   public void setParent(UIComponent parent)
   {
-    _parent = parent;
+    if (parent != _parent)
+    {
+      _parent = parent;
+    
+      // clear cached client ids if necessary
+      if (_clientId != null)
+      {
+        String newClientId = _calculateClientId(FacesContext.getCurrentInstance());
+        
+        // if our clientId changed as a result of being reparented (because we moved
+        // between NamingContainers for instance) then we need to clear out
+        // all of the cached client ids for our subtree
+        if (!_clientId.equals(newClientId))
+        {
+          clearCachedClientIds();
+          _clientId = newClientId;
+        }
+      }
+    }
   }
 
 
@@ -1790,8 +1808,8 @@ abstract public class UIXComponentBase extends UIXComponent
     
     if (cacheClientIds == null)
     {
-      // see if client  is enabled for the application (the default is on)
-      boolean cachingEnabled = !Boolean.TRUE.equals(
+      // see if client  is enabled for the application (the default is off)
+      boolean cachingEnabled = Boolean.TRUE.equals(
                           context.getExternalContext().
                           getApplicationMap().get(_INIT_PROP_CLIENT_ID_CACHING_ENABLED));
       

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 03/36: code cleanup removed synchronization since it is not needed in StyleSheetNodeParser.java In StyleSheetNodeParser, refactored the _init methods to be similar to the _initBrowsers method which was refactored in an earlier checkin by Blake Sullivan. removed unused imports from StyleSheetNode.java

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit ff38a29801d8fc1a3584090813fd202b740aa3ec
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Wed Jan 6 18:34:50 2010 +0000

    code cleanup
    removed synchronization since it is not needed in StyleSheetNodeParser.java
    In StyleSheetNodeParser, refactored the _init methods to be similar to the _initBrowsers method which was refactored in an earlier checkin by Blake Sullivan.
    removed unused imports from StyleSheetNode.java
---
 .../style/xml/parse/StyleSheetNode.java            |  2 -
 .../style/xml/parse/StyleSheetNodeParser.java      | 80 ++++++++++------------
 2 files changed, 37 insertions(+), 45 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
index 73931bb..2b5dc97 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
@@ -25,12 +25,10 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
 
 import org.apache.myfaces.trinidad.context.AccessibilityProfile;
-import org.apache.myfaces.trinidad.context.Version;
 import org.apache.myfaces.trinidadinternal.agent.TrinidadAgent;
 import org.apache.myfaces.trinidadinternal.skin.AgentAtRuleMatcher;
 import org.apache.myfaces.trinidadinternal.style.util.ModeUtils;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
index 681a18c..c9fa73e 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
@@ -21,12 +21,10 @@ package org.apache.myfaces.trinidadinternal.style.xml.parse;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 import java.util.Set;
 import java.util.Vector;
 
@@ -46,8 +44,10 @@ import org.xml.sax.Attributes;
 import org.xml.sax.SAXParseException;
 
 /**
- * NodeParser for style sheet nodes
+ * NodeParser for style sheet nodes. This class is thread-safe since it is created each time 
+ * with newInstance(). Therefore we do not synchronize
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/StyleSheetNodeParser.java#0 $) $Date: 10-nov-2005.18:58:47 $
+ * @see org.apache.myfaces.trinidadinternal.share.xml.ClassParserFactory#getParser
  */
 public class StyleSheetNodeParser extends BaseNodeParser
   implements XMLConstants, StyleConstants
@@ -63,13 +63,13 @@ public class StyleSheetNodeParser extends BaseNodeParser
     Attributes   attrs
     ) throws SAXParseException
   {
-    _initLocales(attrs.getValue(LOCALES_ATTR));
+    _locales = _initLocales(attrs.getValue(LOCALES_ATTR));
     _direction = NameUtils.getDirection(attrs.getValue(DIRECTION_ATTR));
     _mode = NameUtils.getMode(attrs.getValue(MODE_ATTR));
     _browsers = _initBrowsers(attrs.getValue(BROWSERS_ATTR));
-    _initVersions(attrs.getValue(VERSIONS_ATTR));
-    _initPlatforms(attrs.getValue(PLATFORMS_ATTR));
-    _initAccessibilityProperties(attrs.getValue(ACC_PROFILE_ATTR));
+    _versions = _initVersions(attrs.getValue(VERSIONS_ATTR));
+    _platforms = _initPlatforms(attrs.getValue(PLATFORMS_ATTR));
+    _accProperties = _initAccessibilityProperties(attrs.getValue(ACC_PROFILE_ATTR));
   }
 
   /**
@@ -85,8 +85,7 @@ public class StyleSheetNodeParser extends BaseNodeParser
     StyleNode[] styles = null;
     if (_styles != null)
     {
-      styles = new StyleNode[_styles.size()];
-      _styles.copyInto(styles);
+      styles = _styles.toArray(new StyleNode[_styles.size()]);
     }
     // Do not create an agentMatcher if there are no browsers or versions to compare against.
     // This way a styleSheetNode will match any browser if it hasn't specified a specific browser.
@@ -137,22 +136,22 @@ public class StyleSheetNodeParser extends BaseNodeParser
     if (child instanceof StyleNode)
     {
       if (_styles == null)
-        _styles = new Vector<StyleNode>();
+        _styles = new ArrayList<StyleNode>();
 
-      _styles.addElement((StyleNode)child);
+      _styles.add((StyleNode)child);
     }
   }
 
   // Initialize locales
-  private void _initLocales(String localeAttr)
+  private Set<Locale> _initLocales(String localeAttr)
   {
-    if (localeAttr == null)
-      return;
-
-    // -= Simon Lessard =-
-    // TODO: Check if synchronization is really needed.
-    _locales = Collections.synchronizedSet(new HashSet<Locale>());
     Iterator<String> tokens = _getTokens(localeAttr);
+    
+    if (tokens == null)
+      return Collections.emptySet();
+    
+    Set<Locale> locales = new HashSet<Locale>();
+    
     while (tokens.hasNext())
     {
       String localeString = tokens.next();
@@ -160,8 +159,10 @@ public class StyleSheetNodeParser extends BaseNodeParser
       Locale locale = LocaleUtils.getLocaleForIANAString(localeString.replace('_', '-').trim());
 
       if (locale != null)
-        _locales.add(locale);
+        locales.add(locale);
     }
+    
+    return locales;
   }
 
   // Initialize browsers
@@ -185,16 +186,13 @@ public class StyleSheetNodeParser extends BaseNodeParser
   }
 
   // Initialize version
-  private void _initVersions(String versionAttr)
+  private Version[] _initVersions(String versionAttr)
   {
     Iterator<String> versions = _getTokens(versionAttr);
     if (versions == null)
-      return;
-
-    // -= Simon Lessard =-
-    // TODO: Check if synchronization is really needed.
-    
-    Vector<Version> v = new Vector<Version>();
+      return null;
+  
+    List<Version> v = new ArrayList<Version>();
     while (versions.hasNext())
     {
       String version = versions.next();
@@ -204,19 +202,17 @@ public class StyleSheetNodeParser extends BaseNodeParser
       }
     }
     
-    _versions = v.toArray(new Version[v.size()]);
+    return v.toArray(new Version[v.size()]);
   }
 
   // Initialize platforms
-  private void _initPlatforms(String platformAttr)
+  private int[] _initPlatforms(String platformAttr)
   {
     Iterator<String> platforms = _getTokens(platformAttr);
     if (platforms == null)
-      return;
+      return null;
 
-    // -= Simon Lessard =-
-    // TODO: Check if synchronization is really needed.
-    Vector<Integer> v = new Vector<Integer>();
+    List<Integer> v = new ArrayList<Integer>();
     while (platforms.hasNext())
     {
       String platformName = platforms.next();
@@ -227,18 +223,18 @@ public class StyleSheetNodeParser extends BaseNodeParser
         platform = StyleSheetNode.__OS_UNIX;
 
       if (platform != TrinidadAgent.OS_UNKNOWN)
-        v.addElement(platform);
+        v.add(platform);
     }
 
-    _platforms = _getIntegers(v);
+    return _getIntegers(v);
   }
 
   // Initialize accessibility profile properties
-  private void _initAccessibilityProperties(String accProfileAttr)
+  private Set<String> _initAccessibilityProperties(String accProfileAttr)
   {
     Iterator<String> tokens = _getTokens(accProfileAttr);
     if (tokens == null)
-      return;
+      return Collections.emptySet();
 
     // The number of accessibility properties is always small - typically
     // just 1.  Use a small initial capacity.
@@ -258,11 +254,11 @@ public class StyleSheetNodeParser extends BaseNodeParser
       }
     }
     
-    _accProperties = props;
+    return props;
   }
 
-  // Copies Integers from a Vector into an int array
-  private int[] _getIntegers(Vector<Integer> v)
+  // Copies Integers from a List into an int array
+  private int[] _getIntegers(List<Integer> v)
   {
     int count = v.size();
 
@@ -272,7 +268,7 @@ public class StyleSheetNodeParser extends BaseNodeParser
     int[] array = new int[count];
 
     for (int i = 0; i < count; i++)
-      array[i] = v.elementAt(i).intValue();
+      array[i] = v.get(i).intValue();
 
     return array;
   }
@@ -286,9 +282,7 @@ public class StyleSheetNodeParser extends BaseNodeParser
     return (Arrays.asList(XMLUtils.parseNameTokens(attr))).iterator();
   }
 
-  // -= Simon Lessard =-
-  // TODO: Check if synchronization is really needed.
-  private Vector<StyleNode> _styles;
+  private List<StyleNode> _styles;
   private Set<Locale>       _locales;
   private int               _direction;
   private int               _mode;

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 18/36: clean up

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit c12f150ac9d200a495631a6b69df9cc249c1bffd
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Wed Feb 10 22:01:35 2010 +0000

    clean up
---
 .../myfaces/trinidad/util/ComponentReferenceTest.java | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
index f7ad481..f62c452 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.myfaces.trinidad.util;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.ObjectInputStream;
@@ -111,18 +112,22 @@ public class ComponentReferenceTest extends FacesTestCase
 
     try 
     {
-      FileOutputStream fos = new FileOutputStream("t.tmp");
+      FileOutputStream fos = new FileOutputStream("trinidad.failover");
       ObjectOutputStream oos = new ObjectOutputStream(fos);
 
       oos.writeObject(uiRef);
 
-      FileInputStream fis = new FileInputStream("t.tmp");
+      FileInputStream fis = new FileInputStream("trinidad.failover");
       ObjectInputStream ois = new ObjectInputStream(fis);
 
       uiRef = (ComponentReference<UIInput>) ois.readObject();
 
       referencedComp = uiRef.getComponent();
       assertEquals(input, referencedComp);
+
+      // clean up...
+      File failoverFile = new File("trinidad.failover");
+      failoverFile.delete();
     }
     catch (Exception e)
     {
@@ -151,18 +156,22 @@ public class ComponentReferenceTest extends FacesTestCase
     // fake the failover
     try 
     {
-      FileOutputStream fos = new FileOutputStream("t.tmp");
+      FileOutputStream fos = new FileOutputStream("trinidad.failover");
       ObjectOutputStream oos = new ObjectOutputStream(fos);
 
       oos.writeObject(uiRef);
 
-      FileInputStream fis = new FileInputStream("t.tmp");
+      FileInputStream fis = new FileInputStream("trinidad.failover");
       ObjectInputStream ois = new ObjectInputStream(fis);
 
       uiRef = (ComponentReference<UIInput>) ois.readObject();
 
       referencedComp = uiRef.getComponent();
       assertEquals(input1, referencedComp);
+
+      // clean up...
+      File failoverFile = new File("trinidad.failover");
+      failoverFile.delete();
     }
     catch (Exception e)
     {
@@ -516,4 +525,4 @@ public class ComponentReferenceTest extends FacesTestCase
 
     assertEquals(input1, referencedComp);
   }
-}
\ No newline at end of file
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 19/36: TRINIDAD-1613 - Add support for rowKey change

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 29b53ead68980a8dd66fc53abe4a91487603858a
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Wed Feb 10 22:03:19 2010 +0000

    TRINIDAD-1613 - Add support for rowKey change
    
    thanks to Min Lu for her patch
---
 .../myfaces/trinidad/model/CollectionModel.java    |  66 ++++++++++-
 .../myfaces/trinidad/model/RowKeyChangeEvent.java  | 124 +++++++++++++++++++++
 .../trinidad/model/RowKeyChangeListener.java       |  33 ++++++
 3 files changed, 222 insertions(+), 1 deletion(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java
index 4d9716b..bfb83e1 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java
@@ -20,6 +20,7 @@ package org.apache.myfaces.trinidad.model;
 
 import java.util.Collections;
 import java.util.List;
+import java.util.ArrayList;
 import javax.faces.model.DataModel;
 
 /**
@@ -296,6 +297,68 @@ public abstract class CollectionModel extends DataModel
     }
   }
 
+  /**
+   * <p>
+   * Adds the listener to the Set of RowKeyChangeListeners on the Collection.
+   * </p>
+   * <p>
+   * The same listener instance may be added multiple times, but will only be called once per change.
+   * </p>
+   * <p>
+   * Since the Collection may have a lifetime longer than Request, the listener implementation 
+   * should take care not to maintain any references to objects only valid in the current Request.  
+   * For example, if a UIComponent wishes to listen on a Collection, the UIComponent cannot use a 
+   * listener that maintains a Java reference to the UIComponent instance because UIComponent 
+   * instances are only valid for the current request (this also precludes the use of a non-static 
+   * inner class for the listener).  Instead, the UIComponent would need to use an indirect 
+   * reference such as {@link ComponentReference} to dynamically find the correct instance to use.  
+   * In the case where the Collection has a short lifetime, the code that adds the listener needs to 
+   * ensure that it executes every time the Collection instance is reinstantiated.
+   * </p>
+   * @param listener The listener for RowKeyChangeEvents to add to the Collection 
+   * @see #removeRowKeyChangeListener
+   */
+  public void addRowKeyChangeListener(RowKeyChangeListener listener)
+  {
+    if(!_rowKeyChangeListeners.contains(listener))
+      _rowKeyChangeListeners.add(listener);
+  }
+
+  /**
+   * <p>
+   * Remove an existing listener from the Set of RowKeyChangeListeners on the Collection.
+   * </p>
+   * <p>
+   * The same listener instance may be removed multiple times wihtout failure.
+   * </p>
+   * 
+   * @param listener The listener for RowKeyChangeEvents to remove from the Collection
+   */
+  public void removeRowKeyChangeListener(RowKeyChangeListener listener)
+  {
+    _rowKeyChangeListeners.remove(listener);
+  }
+
+  /**
+   * Fire an existing RowKeyChangeEvent to any registered listeners.
+   * No event is fired if the given event's old and new row keys are equal and non-null.
+   * @param event  The RowKeyChangeEvent object.
+   */
+  protected void fireRowKeyChange(RowKeyChangeEvent event) 
+  {
+    Object oldRowKey = event.getOldRowKey();
+    Object newRowKey = event.getNewRowKey();
+    if (oldRowKey != null && newRowKey != null && oldRowKey.equals(newRowKey)) 
+    {
+      return;
+    }
+
+    for (RowKeyChangeListener listener: _rowKeyChangeListeners)
+    {
+      listener.onRowKeyChange(event);
+    }
+  }
+
   //
   // Below is the default implemenation for the LocalRowKeyIndex interface.  
   //
@@ -453,5 +516,6 @@ public abstract class CollectionModel extends DataModel
   {
     return LocalRowKeyIndex.LocalCachingStrategy.NONE;
   }
-  
+
+  private List<RowKeyChangeListener> _rowKeyChangeListeners = new ArrayList<RowKeyChangeListener>(3);    
 }
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeyChangeEvent.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeyChangeEvent.java
new file mode 100644
index 0000000..7433c44
--- /dev/null
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeyChangeEvent.java
@@ -0,0 +1,124 @@
+/*
+ *  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.trinidad.model;
+
+import java.util.EventObject;
+
+/**
+ * Event that is generated when RowKey changes.
+ * This event is fired when a row is updated, inserted or deleted
+ * The oldRowKey or new RowKey can be NULL
+ * 
+ * The serialization behavior depends on the implementation of the collectionModel that consumes 
+ * the RowKeyChangeEvent. If the collectionModel implementation is serializable and keeps track 
+ * of row key change events that it recevies, then these events are serialized with the model; 
+ * otherwise, the events are not serialized
+ */
+public class RowKeyChangeEvent extends EventObject 
+{
+  /**
+   * The operation that triggers row key to change
+   */
+  public enum Cause
+  {
+     UPDATE,
+     INSERT,
+     DELETE
+  };
+  
+  /**
+  * Creates a new RowKeyChangeEvent
+  * @param source    the source of the event
+  * @param oldRowKey the old RowKey.
+  * @param newRowKey the new RowKey.
+  * @param cause the operation that triggers this event
+  */  
+  public RowKeyChangeEvent(CollectionModel source, Object oldRowKey, Object newRowKey, Cause cause)
+  {
+    super(source);
+
+    _oldRowKey = oldRowKey;
+    _newRowKey = newRowKey;
+    _cause = cause;
+  }
+   
+  /**
+  * retrieve the old RowKey from the event
+  * @return the old RowKey of the event.
+  */
+  public Object getOldRowKey()
+  {
+    return _oldRowKey;
+  }
+  
+  /**
+  * retrieve the new row key from the event
+  * @return the new row key of the event.
+  */
+  public Object getNewRowKey()
+  {
+    return _newRowKey;
+  }
+  
+  public Cause getCause()
+  {
+    return _cause;
+  }
+  
+  @Override
+  public boolean equals(Object o)
+  {
+    if (o == this)
+      return true;
+    else if (!(o instanceof RowKeyChangeEvent))
+      return false;
+    else
+    {
+      RowKeyChangeEvent otherEvent = (RowKeyChangeEvent)o;
+
+      return _oldRowKey.equals(otherEvent._oldRowKey) &&
+             _newRowKey.equals(otherEvent._newRowKey) &&
+             _cause == otherEvent._cause;
+    }    
+  }
+
+  @Override
+  public int hashCode()
+  {
+      int hashCode = 17;
+      hashCode = 31 * hashCode + _oldRowKey.hashCode();
+      hashCode = 31 * hashCode + _newRowKey.hashCode(); 
+      hashCode = 31 * hashCode + _cause.hashCode();
+      return hashCode;
+  }
+  
+  @Override
+  public String toString()
+  {
+    return super.toString() +
+           "[oldRowKey=" + _oldRowKey.toString() +
+           ", newRowKey=" + _newRowKey.toString() + 
+           ", cause=" + _cause.toString() + "]";
+  }
+  
+  private final Object _oldRowKey;
+  private final Object _newRowKey;
+  private final Cause _cause;
+  private static final long serialVersionUID = 1L;
+}
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeyChangeListener.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeyChangeListener.java
new file mode 100644
index 0000000..bd1e10e
--- /dev/null
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeyChangeListener.java
@@ -0,0 +1,33 @@
+/*
+ *  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.trinidad.model;
+
+/**
+ * Listener for RowKeyChangeEvent.
+ */
+public interface RowKeyChangeListener
+{
+  /**
+   * Called by CollectionModel to inform a RowKeyChangeListener that a RowKey has changed
+   * The old row key or the new row key can be null, it is expected that listener implementation
+   * to handle these situations with best efforts, for example, clear and rebuild component
+   * state cache to recover.
+   */
+  public void onRowKeyChange(RowKeyChangeEvent event); 
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 27/36: Fixes for TRINIDAD-1740 Replace Trinidad TreeVisiting APIs with JSF 2 TreeVisiting APIs TRINIDAD-1669 Improve transient memory consumption of UIXComponentBase.getClientId()

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 995fe9b32518050f115e877a7be0d75491f460da
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Thu Mar 4 04:27:32 2010 +0000

    Fixes for TRINIDAD-1740 Replace Trinidad TreeVisiting APIs with JSF 2 TreeVisiting APIs
    TRINIDAD-1669 Improve transient memory consumption of UIXComponentBase.getClientId()
    
    UIXComponent was accidentally calling the wrong CoreRenderer versions of setup/tearDownEncoding context (the deprecated ones that take UIXComponents, rather than the correct ones that take UIComponents)
    
    Fix UIXComponentBase clientID caching enabling code
    Speed up clientId clearing when stamping in UIXCollection
---
 .../myfaces/trinidad/component/UIXCollection.java  |  5 +-
 .../myfaces/trinidad/component/UIXComponent.java   | 12 ++---
 .../trinidad/component/UIXComponentBase.java       | 56 ++++++----------------
 3 files changed, 24 insertions(+), 49 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
index 1b3ec68..e90479d 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
@@ -811,7 +811,10 @@ public abstract class UIXCollection extends UIXComponentBase
     // ensure the client IDs are reset on the component, otherwise they will not get the
     // proper stamped IDs. This mirrors the behavior in UIData and follows the JSF specification
     // on when client IDs are allowed to be cached and when they must be reset
-    clearCachedClientIds();
+    List<UIComponent> stamps = getStamps();
+    
+    for (UIComponent stamp : stamps)
+      UIXComponent.clearCachedClientIds(stamp);
   }
 
   /**
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java
index 686a777..da9071e 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java
@@ -316,10 +316,10 @@ abstract public class UIXComponent extends UIComponent
   * whose <code>visit</code> method will be called
   * for each node visited.
   * @return component implementations may return <code>true</code>
-  *   to indicate that the tree visit is complete (eg. all components
-  *   that need to be visited have been visited).  This results in
-  *   the tree visit being short-circuited such that no more components
-  *   are visited.
+  * to indicate that the tree visit is complete (eg. all components
+  * that need to be visited have been visited).  This results in
+  * the tree visit being short-circuited such that no more components
+  * are visited.
   *
   * @see VisitContext#invokeVisitCallback VisitContext.invokeVisitCallback()
   */
@@ -858,7 +858,7 @@ abstract public class UIXComponent extends UIComponent
     {
       CoreRenderer coreRenderer = (CoreRenderer)renderer;
 
-      coreRenderer.setupEncodingContext(context, rc, this);
+      coreRenderer.setupEncodingContext(context, rc, (UIComponent)this);
     }
   }
 
@@ -912,7 +912,7 @@ abstract public class UIXComponent extends UIComponent
       {
         CoreRenderer coreRenderer = (CoreRenderer)renderer;
 
-        coreRenderer.tearDownEncodingContext(context, rc, this);
+        coreRenderer.tearDownEncodingContext(context, rc, (UIComponent)this);
       }
     }
     finally
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
index 335c8f8..a1b5b01 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
@@ -30,8 +30,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import java.util.concurrent.atomic.AtomicReference;
 
 import javax.el.ELContext;
@@ -264,8 +262,6 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
 
-
-
   /**
    */
   @Override
@@ -285,7 +281,6 @@ abstract public class UIXComponentBase extends UIXComponent
     return getFacesBean().getValueBinding(key);
   }
 
-
   @Override
   public void setValueBinding(String name, ValueBinding binding)
   {
@@ -296,7 +291,6 @@ abstract public class UIXComponentBase extends UIXComponent
     getFacesBean().setValueBinding(key, binding);
   }
 
-
   @Override
   public Map<String, Object> getAttributes()
   {
@@ -348,8 +342,6 @@ abstract public class UIXComponentBase extends UIXComponent
     return clientId;
   }
   
-
-
   @Override
   public String getClientId(FacesContext context)
   {
@@ -385,14 +377,13 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
 
-
   /**
    * Gets the identifier for the component.  This implementation
    * never returns a null id.
    */
   @Override
   public String getId()
-  {  
+  {
     // determine whether we can use the optimized code path or not
     if (_usesFacesBeanImpl)
     {
@@ -425,7 +416,6 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
 
-
   /**
    * Sets the identifier for the component.  The identifier
    * must follow a subset of the syntax allowed in HTML:
@@ -472,14 +462,12 @@ abstract public class UIXComponentBase extends UIXComponent
   @Override
   abstract public String getFamily();
 
-
   @Override
   public UIComponent getParent()
   {
     return _parent;
   }
 
-
   /**
    * <p>Set the parent <code>UIComponent</code> of this
    * <code>UIComponent</code>.</p>
@@ -511,14 +499,12 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
 
-
   @Override
   public boolean isRendered()
   {
     return getBooleanProperty(RENDERED_KEY, true);
   }
 
-
   @Override
   public void setRendered(boolean rendered)
   {
@@ -567,7 +553,6 @@ abstract public class UIXComponentBase extends UIXComponent
     setProperty(RENDERER_TYPE_KEY, rendererType);
   }
 
-
   @Override
   public boolean getRendersChildren()
   {
@@ -578,13 +563,8 @@ abstract public class UIXComponentBase extends UIXComponent
     return renderer.getRendersChildren();
   }
 
-
-
-
   // ------------------------------------------------ Tree Management Methods
 
-
-
   @Override
   public UIComponent findComponent(String id)
   {
@@ -655,8 +635,6 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
 
-
-
   /**
    * <p>Create (if necessary) and return a List of the children associated
    * with this component.</p>
@@ -679,7 +657,6 @@ abstract public class UIXComponentBase extends UIXComponent
       return getChildren().size();
   }
 
-
   /**
    * <p>Create (if necessary) and return a Map of the facets associated
    * with this component.</p>
@@ -694,7 +671,6 @@ abstract public class UIXComponentBase extends UIXComponent
     return _facets;
   }
 
-
   @Override
   public UIComponent getFacet(String facetName)
   {
@@ -707,7 +683,6 @@ abstract public class UIXComponentBase extends UIXComponent
       return getFacets().get(facetName);
   }
 
-
   /**
    * Returns an Iterator over the names of all facets.
    * Unlike getFacets().keySet().iterator(), this does
@@ -795,9 +770,8 @@ abstract public class UIXComponentBase extends UIXComponent
   }
 
   // ------------------------------------------- Lifecycle Processing Methods
-
-
-  @Override
+  
+@Override
   public void decode(FacesContext context)
   {
     if (context == null)
@@ -1069,7 +1043,6 @@ abstract public class UIXComponentBase extends UIXComponent
     return FacesContext.getCurrentInstance();
   }
 
-
   /**
    * Delegates to LifecycleRenderer, if present,
    * otherwise calls decodeChildrenImpl.
@@ -1104,7 +1077,6 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
 
-
   /**
    * Delegates to LifecycleRenderer, if present,
    * otherwise calls validateChildrenImpl.
@@ -1140,7 +1112,6 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
 
-
   /**
    * Delegates to LifecycleRenderer, if present,
    * otherwise calls upateChildrenImpl.
@@ -1326,7 +1297,6 @@ abstract public class UIXComponentBase extends UIXComponent
     return n.intValue();
   }
 
-
   /**
    * Return the number of facets.  This is more efficient than
    * calling getFacets().size();
@@ -1340,7 +1310,6 @@ abstract public class UIXComponentBase extends UIXComponent
     return _facets.size();
   }
 
-
   /**
    * Broadcast an event to a MethodBinding.
    * This can be used to support MethodBindings such as the "actionListener"
@@ -1493,7 +1462,6 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
   
-
   /**
    * Override to calls the hooks for setting up and tearing down the
    * context before the children are visited.
@@ -1506,7 +1474,7 @@ abstract public class UIXComponentBase extends UIXComponent
     String clientId,
     ContextCallback callback)
     throws FacesException
-  {    
+  {
     String thisClientId = getClientId(context);
 
     if (clientId.equals(thisClientId))
@@ -1617,7 +1585,6 @@ abstract public class UIXComponentBase extends UIXComponent
     }
   }
 
-
   static private UIComponent _findInsideOf(
     UIComponent from,
     String id)
@@ -1746,7 +1713,6 @@ abstract public class UIXComponentBase extends UIXComponent
   //private transient boolean _initialStateMarked;
 
   private static final Iterator<String> _EMPTY_STRING_ITERATOR = CollectionUtils.emptyIterator();
-
   private static final Iterator<UIComponent> _EMPTY_UICOMPONENT_ITERATOR =
                                                                   CollectionUtils.emptyIterator();
 
@@ -1801,6 +1767,9 @@ abstract public class UIXComponentBase extends UIXComponent
   {
   }
 
+  /**
+   * Temporary function controlling whether clientId caching is enabled
+   */
   private static boolean _isClientIdCachingEnabled(FacesContext context)
   {
     if (context == null)
@@ -1810,11 +1779,14 @@ abstract public class UIXComponentBase extends UIXComponent
     
     if (cacheClientIds == null)
     {
-      // see if client  is enabled for the application (the default is off)
-      boolean cachingEnabled = Boolean.TRUE.equals(
-                          context.getExternalContext().
-                          getApplicationMap().get(_INIT_PROP_CLIENT_ID_CACHING_ENABLED));
+      // get the servlet initialization parameter
+      String cachingParam = context.getExternalContext().getInitParameter(
+                                                             _INIT_PROP_CLIENT_ID_CACHING_ENABLED);
       
+      Boolean cachingEnabled  = (cachingParam != null)
+                                  ? Boolean.valueOf(cachingParam)
+                                  : Boolean.FALSE;  // default to false
+
       // cache the servlet initialization value
       _sClientIdCachingEnabled.set(cachingEnabled ? Boolean.TRUE : Boolean.FALSE);
 

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 31/36: TRINIDAD-1746 move InputStreamProvider to be a public API also move NameResolver to be public. forgot to add the new files in the previous checkin!

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 048678a763aa18e38c7375c97b1cc87fa8bef6fa
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Mar 9 21:24:01 2010 +0000

    TRINIDAD-1746 move InputStreamProvider to be a public API
    also move NameResolver to be public.
    forgot to add the new files in the previous checkin!
---
 .../trinidad/share/io/InputStreamProvider.java     | 82 ++++++++++++++++++++++
 .../myfaces/trinidad/share/io/NameResolver.java    | 57 +++++++++++++++
 2 files changed, 139 insertions(+)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/InputStreamProvider.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/InputStreamProvider.java
new file mode 100644
index 0000000..b521331
--- /dev/null
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/InputStreamProvider.java
@@ -0,0 +1,82 @@
+/*
+ *  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.trinidad.share.io;
+
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * InputStreamProviders encapsulate a single target file. An InputStreamProvider is used to 
+ * get an inputStream, cache results and see if the file has been modified. 
+ * (There's no real requirement that there be a physical file
+ * at the target location).
+ * <p>
+ * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/io/InputStreamProvider.java#0 $) $Date: 10-nov-2005.19:00:08 $
+ */
+public interface InputStreamProvider
+{
+  /**
+   * Return an InputStream for the target.  This function
+   * should never return null - if a stream cannot be opened,
+   * throw an IOException.
+   */
+  public InputStream       openInputStream() throws IOException;
+
+  /**
+   * Returns the name of the target location, suitable
+   * for user display.
+   */
+  public String            getDisplayName();
+
+  /**
+   * Returns an identifier object that uniquely
+   * identifies the target location. If two providers
+   * return equal identifiers, that is, given:
+   * <pre>
+   *   Object identifierA = providerA.getIdentifier();
+   *   Object identifierB = providerB.getIdentifier();
+   * </pre>
+   * ... then:
+   * <pre>
+   *   if (identifierA.equals(identifierB)) ...
+   * </pre>
+   * then the two providers must point to the same location.
+   */
+  public Object            getIdentifier();
+
+  /**
+   * Returns true if the underlying target has changed
+   * since the last call to openInputStream()
+   */
+  public boolean           hasSourceChanged();
+
+  /**
+   * Returns the cached result from reading and parsing this
+   * provider.
+   * @see CachingNameResolver
+   */
+  public Object            getCachedResult();
+
+  /**
+   * Stores the cached result of reading and parsing this
+   * provider.
+   * @see CachingNameResolver
+   */
+  public void              setCachedResult(Object value);
+}
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/NameResolver.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/NameResolver.java
new file mode 100644
index 0000000..fcd3094
--- /dev/null
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/NameResolver.java
@@ -0,0 +1,57 @@
+/*
+ *  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.trinidad.share.io;
+
+import java.io.IOException;
+
+
+
+/**
+ * NameResolvers are responsible for converting string names
+ * into InputStreamProviders, which encapsulate a remote file.
+ * Implementations exist that support using URLs, Files, Class
+ * resources, and the Servlet API to locate files, but other APIs
+ * may be substituted.
+ * <p>
+ * In some cases, the resolved target file may have need to
+ * locate support files of its own (like imported css files).  Since those support files should
+ * be looked for relative to the target file, NameResolver supports
+ * creating new relative NameResolvers.
+ * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/io/NameResolver.java#0 $) $Date: 10-nov-2005.19:00:09 $
+ */
+public interface NameResolver
+{
+  /**
+   * Given a name, returns an InputStreamProvider.  This
+   * function should never return null - if the target
+   * cannot be resolved, throw an IOException.
+   * @param name the name of the target
+   */
+  public InputStreamProvider getProvider(String name) throws IOException;
+
+  /**
+   * Return the new NameResolver that should be used to resolve
+   * names relative to a given name.  This function should never
+   * return null - if the target cannot be resolved, return a
+   * resolver that can only support absolute names.
+   * @param name the name of the target
+   */
+  public NameResolver        getResolver(String name);
+}
+

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 26/36: Fix setId() to clear the cached clientId at the end of the function so that the code that checks whether we have a cached clientId works correctly Add tests for the basic cases where a cached clientId needs to be cleared--setting the id of a NamingContainer (clear subtree), setting the id of a component (clear component's cached clientId), move component between NamingContainers (clear subtree)

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 433da04aac0111da452448551e817bc543daa853
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Wed Mar 3 01:01:13 2010 +0000

    Fix setId() to clear the cached clientId at the end of the function so that the code that checks whether we have a cached clientId works correctly
    Add tests for the basic cases where a cached clientId needs to be cleared--setting the id of a NamingContainer (clear subtree), setting the id of a component (clear component's cached clientId), move component between NamingContainers (clear subtree)
---
 .../trinidad/component/UIXComponentBase.java       |   6 +-
 .../trinidad/component/ClientIdCachingTest.java    | 143 +++++++++++++++++++++
 2 files changed, 147 insertions(+), 2 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
index ff71c3f..335c8f8 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
@@ -362,7 +362,9 @@ abstract public class UIXComponentBase extends UIXComponent
         clientId = _calculateClientId(context);
         
         if (_usesFacesBeanImpl)
+        {
           _clientId = clientId;
+        }
       }
       else
       {
@@ -436,8 +438,6 @@ abstract public class UIXComponentBase extends UIXComponent
   @Override
   public void setId(String id)
   {
-    _clientId = null;
-    
     FacesBean facesBean = getFacesBean();
     
     // if we are using a FacesBeanImpl, then the FacesBean will
@@ -465,6 +465,8 @@ abstract public class UIXComponentBase extends UIXComponent
       _validateId(id);
       facesBean.setProperty(ID_KEY, id);      
     }
+
+    _clientId = null;
   }
   
   @Override
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/ClientIdCachingTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/ClientIdCachingTest.java
new file mode 100644
index 0000000..aa46806
--- /dev/null
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/ClientIdCachingTest.java
@@ -0,0 +1,143 @@
+/*
+ *  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.trinidad.component;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.context.FacesContext;
+import javax.faces.render.Renderer;;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
+import org.apache.myfaces.trinidad.component.UIXPanel;
+
+public class ClientIdCachingTest extends FacesTestCase
+{
+  public static final Test suite()
+  {
+    return new TestSuite(ClientIdCachingTest.class);
+  }
+  
+  public static void main(String[] args) throws Throwable
+  {
+    junit.textui.TestRunner.run(suite());
+  }
+
+  public ClientIdCachingTest(
+    String testName)
+  {
+    super(testName);
+  }
+
+  static private class TestPanel extends UIXPanel
+  {
+    protected Renderer getRenderer(FacesContext context)
+    {
+      return null;
+    }
+  }
+
+  static private class TestNamingContainer extends TestPanel
+                                           implements NamingContainer
+  {
+  }
+
+  // Test nested NamingContainer callbacks
+  @SuppressWarnings("unchecked")
+  public void testBasic()
+  {
+    TestNamingContainer a = new TestNamingContainer(); a.setId("a");
+    TestNamingContainer b = new TestNamingContainer(); b.setId("b");
+    TestNamingContainer d = new TestNamingContainer(); d.setId("d");
+    TestPanel e = new TestPanel(); e.setId("e");
+    TestPanel g = new TestPanel(); g.setId("g");
+    a.getChildren().add(b);
+    b.getChildren().add(d);
+    b.getChildren().add(g);
+    d.getChildren().add(e);
+    
+    FacesContext context = FacesContext.getCurrentInstance();
+    assertEquals("a:b:d:e", e.getClientId(context));
+  }
+  
+  public void testSetId()
+  {
+    TestNamingContainer a = new TestNamingContainer(); a.setId("a");
+    TestNamingContainer b = new TestNamingContainer(); b.setId("b");
+    TestNamingContainer d = new TestNamingContainer(); d.setId("d");
+    TestPanel e = new TestPanel(); e.setId("e");
+    TestPanel g = new TestPanel(); g.setId("g");
+    a.getChildren().add(b);
+    b.getChildren().add(d);
+    b.getChildren().add(g);
+    d.getChildren().add(e);
+
+    // prime    
+    FacesContext context = FacesContext.getCurrentInstance();
+    assertEquals("a:b:d:e", e.getClientId(context));
+
+    // set the component's id using accessor
+    e.setId("ePrime");
+    assertEquals("a:b:d:ePrime", e.getClientId(context));
+    
+    // set the component's id using attribute map
+    e.getAttributes().put("id", "eDoublePrime");
+    assertEquals("a:b:d:eDoublePrime", e.getClientId(context));
+    
+
+    // set an ancsestor's id using accessor
+    b.setId("bPrime");
+    assertEquals("a:bPrime:d:eDoublePrime", e.getClientId(context));
+    
+    // set the component's id using attribute map
+    b.getAttributes().put("id", "bDoublePrime");
+    assertEquals("a:bDoublePrime:d:eDoublePrime", e.getClientId(context));
+  }
+
+  public void testMoving()
+  {
+    TestNamingContainer a = new TestNamingContainer(); a.setId("a");
+    TestNamingContainer b = new TestNamingContainer(); b.setId("b");
+    TestNamingContainer c = new TestNamingContainer(); c.setId("c");
+    TestNamingContainer d = new TestNamingContainer(); d.setId("d");
+    TestPanel e = new TestPanel(); e.setId("e");
+    TestPanel f = new TestPanel(); f.setId("f");
+    TestPanel g = new TestPanel(); g.setId("g");
+    a.getChildren().add(b);
+    a.getChildren().add(c);
+    b.getChildren().add(d);
+    b.getChildren().add(g);
+    d.getChildren().add(e);
+    d.getChildren().add(f);
+
+    // prime    
+    FacesContext context = FacesContext.getCurrentInstance();
+    assertEquals("a:b:d:e", e.getClientId(context));
+
+    // move within same NamingContainer--no clientId change
+    f.getChildren().add(e);
+    assertEquals("a:b:d:e", e.getClientId(context));
+    
+    // move between NamingContainers
+    g.getChildren().add(e);
+    assertEquals("a:b:e", e.getClientId(context)); 
+  }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 08/36: TRINIDAD-1678 TrNumberFormat.prototype.numberToString doesn't account for numbers represented via scientific notation commit for Cale Scholl

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit c96ad4c92b32bdabb6ac0dbd4ffdfc8353f2301c
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Thu Jan 21 04:05:15 2010 +0000

    TRINIDAD-1678 TrNumberFormat.prototype.numberToString doesn't account for numbers represented via scientific notation
    commit for Cale Scholl
---
 .../javascript/META-INF/adf/jsLibs/CoreFormat.js   |  8 ++-
 .../javascript/META-INF/adf/jsLibs/NumberFormat.js | 68 ++++++++++++++++++++++
 2 files changed, 73 insertions(+), 3 deletions(-)

diff --git a/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js b/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
index 0304a3a..8dbbd55 100644
--- a/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
+++ b/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/CoreFormat.js
@@ -957,15 +957,17 @@ function _decimalParse(
     var floater = false;
     if (parsefloat != null)
     {
-      // Why parseInt(parseFloat(numberString))? Because the server NumberConverter behaves the same 
-      // way as parseFloat. Note the following:
+      // Why trim leading zeroes? parseFloat behaves the same way as the server NumberConverter, 
+      // but parseInt interprets octal, and thus we need to trim leading zeroes. 
+      // Note the following:
       // parseInt interprets octal and hex:
       //   alert(parseInt("0xA")); // returns 10
       //   alert(parseInt("008")); // returns 0, as it stops parsing octal at the first invalid character, 8
       // parseFloat interprets neither octal nor hex:
       //   alert(parseFloat("0xA")); // returns 0, as it stops parsing decimal at the first invalid character, x
       //   alert(parseFloat("008")); // returns 8
-      result = parsefloat ? parseFloat(numberString) : parseInt(parseFloat(numberString));
+      numberString = TrNumberFormat.trimLeadingZeroes(numberString);
+      result = parsefloat ? parseFloat(numberString) : parseInt(numberString);
     }
     else
     {
diff --git a/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js b/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js
index 5a030f4..0f2ca76 100644
--- a/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js
+++ b/trinidad-impl/src/main/javascript/META-INF/adf/jsLibs/NumberFormat.js
@@ -338,6 +338,10 @@ TrNumberFormat.prototype.numberToString = function(number)
     number = (number*-1);
 
   var numberString = number + "";
+  
+  // check for scientific notation
+  numberString = TrNumberFormat.scientificToExpanded(numberString);
+  
   var index = numberString.indexOf(".");
   var numberStringLength = numberString.length;
   var ints;
@@ -418,6 +422,70 @@ TrNumberFormat.prototype.percentageToString = function(number)
 }
 
 /**
+ * Static utility function.
+ * Converts a number string from scientific notation to standard expanded notation.
+ */
+TrNumberFormat.scientificToExpanded = function(numberString)
+{
+  // check for scientific notation
+  var expIndex = numberString.indexOf('e');
+  if (expIndex == -1)
+    return numberString;
+    
+  var prefix = "";
+  if (numberString.charAt(0) == '-')
+  {
+    prefix = "-";
+    numberString = numberString.substring(1);
+    expIndex -= 1;
+  }
+  
+  var isPosExp = numberString.charAt(expIndex + 1) == '+';
+  var exp = parseInt(numberString.substring(expIndex + 2));
+  var nFractionDigits = expIndex - 2;
+  var zeroes = "";
+  
+  // The exponent should always be greater than the number of fraction digits.
+  if (isPosExp)
+  {
+    for (var i = 0; i < exp - nFractionDigits; ++i)
+      zeroes += "0";
+      
+    return prefix + numberString.charAt(0) + numberString.substring(2, expIndex) + zeroes;
+  }
+  
+  // ELSE: negative exponent
+  for (var i = 0; i < exp - 1; ++i)
+    zeroes += "0";
+    
+  return prefix + "0." + zeroes + numberString.charAt(0) + numberString.substring(2, expIndex);
+}
+
+/**
+ * Static utility function.
+ * Trims extraneous leading zeroes.
+ */
+TrNumberFormat.trimLeadingZeroes = function(numberString)
+{
+  var strbuf = [];
+  var i, char;
+  for (i = 0; i < numberString.length; ++i)
+  {
+    char = numberString.charAt(i);
+    
+    if ((char >= '1' && char <= '9') || char == '.')
+      break;
+      
+    if (char == '0' && i+1 < numberString.length && numberString.charAt(i+1) != '.')
+      continue;
+      
+    strbuf.push(char);
+  }
+  
+  return strbuf.join('') + numberString.substring(i);
+}
+
+/**
  * helper for rounding values
  */
 TrNumberFormat.prototype.getRounded = function(val)

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 28/36: TRINIDAD-1739 ComponentReference doesn't work with bindings and should be more thread-safe

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 6056352a147e7b6d96078efffe178e7f5cebb6f2
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Fri Mar 5 17:02:16 2010 +0000

    TRINIDAD-1739 ComponentReference doesn't work with bindings and should be more thread-safe
    
    The solution to 1) is to internally use two different implementations--one for the case where the component meets the current requirements, the second to handle the case where the component has no id or isn't in the component tree yet. In this case, we defer calculating the scoped id until all call that requires a scoped id--getComponent(), hashCode() and equals(). At this point, presumably the component is in the tree and if it isn't we throw an IllegalStateException (instead of the  [...]
    
    The thread-safety solution is to make judicious use of thread-safe references to mutable data internally and guarantee that getComponent() can be called on an instantiated ComponentReference as long as the call is made from a Thread with a FacesContext.
---
 .../myfaces/trinidad/util/ComponentReference.java  | 654 +++++++++++++++------
 .../trinidad/util/ComponentReferenceTest.java      |  50 +-
 .../config/GlobalConfiguratorImpl.java             |  40 +-
 3 files changed, 572 insertions(+), 172 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java
index fa1a1cd..39f8b02 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java
@@ -18,8 +18,11 @@
  */
 package org.apache.myfaces.trinidad.util;
 
+import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -32,132 +35,271 @@ import javax.faces.context.FacesContext;
 /**
  * A utility to store a reference to an <code>UIComponent</code>. Application developers
  * should use this tool if they need to have a reference to an instance of the
- * <code>UIComponent</code> class in <code>managed beans</code> that are <b>session scoped</b>.
+ * <code>UIComponent</code> class in <code>managed beans</code> that are longer than <b>requested scoped</b>
+ * --for example Session and Application Scoped.  The reference will return the UIComponent, if any, with
+ * the same scoped id as the Component used to create the reference, in the current UIViewRoot.
  * 
  * Use <code>newUIComponentReference()</code> to create a <code>ComponentReference</code> and
  * use the <code>getComponent()</code> to look up the referenced <code>UIComponent</code>.
+ *  
+ * For example, a current weather application might have have a session scoped weatehrBean
+ * containing the current list of locations to report the weather on and support using a
+ * selectMany component to remove the locations:
  * 
+ * <pre>
+ * <tr:selectManyCheckbox label="Locations" id="smc1" valuePassThru="true"
+ *                        binding="#{weatherBean.locationsSelectManyComponent}"
+ *                       value="#{weatherBean.locationsToRemove}">
+ *    <f:selectItems value="#{weatherBean.locationSelectItems}" id="si1"/>
+ * </tr:selectManyCheckbox>
+ * <tr:commandButton id="deleteCB" text="Remove Locations"
+ *                  actionListener="#{weatherBean.removeLocationListener}">
+ * </tr:commandButton>
+ * </pre>
+ * The weatherBean might looks like this:
+ * <pre>
+ * public class WeatherBean implements Serializable
+ * {
+ *   public void setLocationsToRemove(UIXSelectMany locationsToRemove)
+ *   {
+ *     _locationsToRemove = locationsToRemove;
+ *   }
+ *   
+ *   public UIXSelectMany getLocationsToRemove()
+ *   {
+ *     return _locationsToRemove;
+ *   }
+ *   
+ *   public void removeLocationListener(ActionEvent actionEvent)
+ *   {
+ *     ... code calling getLocationsToRemove() to get the UIXSelectMany ...
+ *   }
+ *
+ *   private UIXSelectMany _locationsToRemove
+ * }
+ * </pre>
+ * This code has several problems:
+ * <ol>
+ *   <li>Since UIComponents aren't Serializable, the class will fail serialization during fail-over
+ *   when default Serialization attempts to serialize _locationsToRemove.</li>
+ *   <li>If the user opens two windows on this page, only the last window rendered have the
+ *   correct UIXSelectMany instance.  If the remove locations button is pressed on the first
+ *   window after rendering the second window, the wrong UIXSelectMany instance will be used.</li>
+ *   <li>Since UIComponents aren't thread-safe, the above case could also result in bizare
+ *   behavior if requests from both windows were being processed by the application server at the
+ *   same time.</li>
+ *   <li>If the Trinidad view state token cache isn't used, or if the user navigates to this page
+ *   using the backbutton, a new UIXSelectMany instance will be created, which also won't match
+ *   the instance we are holding onto.</li>
+ *   <li>If we don't clear the UIXSelectMany instance when we navigate off of this page, we will
+ *   continue to pin the page's UIComponent tree in memory for the lifetime of the Session.
+ *   </li>
+ * </ol>
+ * Rewritten using ComponentReference, the weatherBean might looks like this:
+ * <pre>
+ * public class WeatherBean implements Serializable
+ * {
+ *   public void setLocationsToRemove(UIXSelectMany locationsToRemove)
+ *   {
+ *     _locationsToRemoveRef = UIComponentReference.newUIComponentReference(locationsToRemove);
+ *   }
+ *   
+ *   public UIXSelectMany getLocationsToRemove()
+ *   {
+ *     return _locationsToRemoveRef.getComponent();
+ *   }
+ *   
+ *   public void removeLocationListener(ActionEvent actionEvent)
+ *   {
+ *     ... code calling getLocationsToRemove() to get the UIXSelectMany ...
+ *   }
+ *
+ *   private UIComponentReference<UIXSelectMany> _locationsToRemoveRef
+ * }
+ * </pre>
+ * The above code saves a reference to the component passed to the managed bean and then
+ * retrieves the correct instance given the current UIViewRoot for this request whenever
+ * <code>getLocationsToRemove()</code> is called.
  * <p><b>Please note:</b>
  * <ul>
- * <li>This class is <b>not</b> thread-safe, since it depends on <code>UIComponent</code> APIs.
- * <li>The passed in <code>UIComponent</code> is <b>required</b> to have an <code>ID</code>
- * <li>The reference will break if the <code>UIComponent</code> is moved between <code>NamingContainer</code>s <b>or</b>
- * if any of the ancestor <code>NamingContainer</code>s have their IDs changed.
- * <li>The refrence is persistable. <b>However</b> <code>UIComponent</code>s are not <code>Serializable</code> and therefore
- * can not be used at any scope longer than request.
- * 
+ * <li>This class is <b>not completely</b> thread-safe, since it depends on <code>UIComponent</code>
+ * APIs, however the class is safe to use as long as either of the following is true
+ * <ol>
+ * <li>The component passed to <code>newUIComponentReference</code> has an id and is in the
+ * component hierarchy when newUIComponentReference is called and all subsequent calls to
+ * <code>getComponent</code> are made from Threads with a valid FacesContext
+ * </li>
+ * <li>The first call to <code>getComponent</code> is on the same Thread that
+ * <code>newUIComponentReference</code> was called on</li>
+ * </ol>
+ * </li>
+ * <li>The passed in <code>UIComponent</code> is <b>required</b> to have an <code>ID</code></li>
+ * <li>The reference will break if the <code>UIComponent</code> is moved between
+ * <code>NamingContainer</code>s <b>or</b>
+ * if any of the ancestor <code>NamingContainer</code>s have their IDs changed.</li>
+ * <li>The reference is persistable. <b>However</b> <code>UIComponent</code>s are not
+ * <code>Serializable</code> and therefore can not be used at any scope longer than request.</li>
  * </ul>
  * 
  * @see ComponentReference#newUIComponentReference(UIComponent)
  * @see ComponentReference#getComponent()
  */
-public final class ComponentReference<T extends UIComponent> implements Serializable
+public abstract class ComponentReference<T extends UIComponent> implements Serializable
 {
-  /**
-   * Private constructor, used by <code>ComponentReference.newUIComponentReference</code> 
-   * @param uicomponent the <code>UIComponent</code> we want to store the path for
-   */
-  private ComponentReference(T uicomponent)
+  // don't allow other subclasses
+  private ComponentReference(List<Object> componentPath)
   {
-    // create the "component path" to remember the position of the uicomponent and begin
-    // the work to figureout the scopedID
-    _scopedId = _createComponentPathAndScopedId(uicomponent, null);
+    _componentPath = componentPath;
   }
 
   /**
-   * Factory method to create an instance of the <code>ComponentReference</code> class, which wraps the given
-   * <code>UIComponent</code>. The component must be in the component tree when this method
-   * is called and that we will throw an <code>IllegalArgumentException</code> if it is not.
+   * Factory method to create an instance of the <code>ComponentReference</code> class, which
+   * returns a Serializable and often thread-safe reference to a 
+   * <code>UIComponent</code>.
    * 
-   * @param uicomponent the <code>UIComponent</code> to wrap.
-   * @throws IllegalArgumentException if component is not in the component tree
-   * @throws IllegalArgumentException if component does <b>not</b> have an <code>Id</code>
-   * @return <code>ComponentReference</code> that wrap the given component
+   * @param component the <code>UIComponent</code> to create a reference to.
+   * @return <code>ComponentReference</code> the reference to the component
+   * @throws NullPointerException if component is <code>null</code>
    */
-  public static <T extends UIComponent> ComponentReference<T> newUIComponentReference(T uicomponent)
+  public static <T extends UIComponent> ComponentReference<T> newUIComponentReference(T component)
   {
-    return new ComponentReference<T>(uicomponent);
-  }
+    // store the id of the component as a transient field since we can grab it from the scoped id
+    // but want it available to validate the component we found from the path
+    String compId = component.getId();
 
+    // if the component is in the hierarchy, the topmost component will be the UIViewRoot
+    if ((compId != null) && (getUIViewRoot(component) != null))
+    {
+      // component has an id and is in the hierarachy, so we can use a stable reference
+      String scopedId = calculateScopedId(component, compId);
+      
+      return new StableComponentReference(scopedId, compId, calculateComponentPath(component));
+    }
+    else
+    {
+      // Oh well, deferred reference it is
+      ComponentReference<T> reference = new DeferredComponentReference<T>(component);
+      
+      // Add to the list of Referernces that may need initialization
+      _addToEnsureInitializationList(reference);
+      
+      return reference;
+    }
+  }
+  
   /**
    * This method will use a calculated "component path" to walk down to the <code>UIComponent</code>
    * that is referenced by this class. If the component can not be found, the <code>getComponent()</code>
    * will return <code>null</code>. 
    * 
    * @return the referenced <code>UIComponent</code> or <code>null</code> if it can not be found.
+   * @throws IllegalStateException if the component used to create the
+   * ComponentReference is not in the component tree or does <b>not</b> have an <code>Id</code>
    * @see ComponentReference#newUIComponentReference(UIComponent)
    */
-  @SuppressWarnings("unchecked")
-  public T getComponent()
+   @SuppressWarnings("unchecked")
+   public final T getComponent()
+   {
+     // get the scopedId, calculating it if necessary
+     String scopedId = getScopedId();
+         
+     UIComponent foundComponent = null;
+
+     // In order to find the component with its
+     // calculated path, we need to start at the ViewRoot;
+     UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
+
+     List<Object> componentPath = _componentPath;
+     
+     if (componentPath != null) 
+     {
+       // Walk down the component tree, to the component we are looking for.
+       // We start at the ViewRoot and use the previous calculated "component path"
+       foundComponent = _walkPathToComponent(root, componentPath);
+     }
+
+     // Check if we really found it with the previously created "component path"
+     if (foundComponent == null || (!getComponentId().equals(foundComponent.getId())))
+     {
+       // OK, we were not luck with the calculated "component path", let's
+       // see if we can find it by using the "scoped ID" and the regular 
+       // findComponent();
+       foundComponent = root.findComponent(scopedId);
+
+       // was the regular findComponent() successful ?
+       if (foundComponent != null)
+       {        
+         // OK, now let's rebuild the path
+         _componentPath = calculateComponentPath(foundComponent);
+       }
+     }
+
+     return (T)foundComponent;
+   }
+
+   /**
+    * Called by the framework to ensure that deferred ComponentReferences are completely
+    * initialized before the UIComponent that the ComponentReference is associated with
+    * is not longer valid.
+    * @throws IllegalStateException if ComponentReference isn't already initialized and 
+    * the component used to create the
+    * ComponentReference is not in the component tree or does <b>not</b> have an <code>Id</code>
+    */
+   public abstract void ensureInitialization();
+    
+  /**
+   * ComponentRefs are required to test for equivalence by the equivalence of their scoped ids
+   * @param o
+   * @return
+   */
+  @Override
+  public final boolean equals(Object o)
   {
-    UIComponent foundComponent = null;
-
-    // In order to find the component with its
-    // calculated path, we need to start at the ViewRoot;
-    UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
-
-
-    if (_componentPath != null) 
+    if (o == this)
     {
-      // Walk down the component tree, to the component we are looking for.
-      // We start at the ViewRoot and use the previous calculated "component path"
-      foundComponent = _walkPathToComponent(root, _componentPath);
+      return true;
     }
-
-    // Check if we really found it with the previously created "component path"
-    if (foundComponent == null || (!_componentId.equals(foundComponent.getId())))
+    else if (o instanceof ComponentReference)
     {
-      // OK, we were not luck with the calculated "component path", let's
-      // see if we can find it by using the "scoped ID" and the regular 
-      // findComponent();
-      foundComponent = root.findComponent(_scopedId);
-
-      // was the regular findComponent() successful ?
-      if (foundComponent != null)
-      {        
-        // OK, now let's rebuild the path
-        _createComponentPathAndScopedId(foundComponent, _scopedId);
-      }
+      return getScopedId().equals(((ComponentReference)o).getScopedId());
+    }
+    else
+    {
+      return false;
     }
-
-    return (T) foundComponent;
   }
-
-  /**
-   * Utility to (re) create the component Id from the <code>_scopedId</code>.
-   * 
-   * @return the extracted <code>UIComponentId</code>
-   */
-  private String _calculateComponentIdFromScopedId(String scopedId)
+ 
+   /**
+    * ComponentRefs must use the hash code of their scoped id as their hash code
+    * @return
+    */
+  @Override
+  public final int hashCode()
   {
-    // String.substring() is optimized to return this if the entire string
-    // is the substring so that no one tries to optimize it later
-    return scopedId.substring(scopedId.lastIndexOf(NamingContainer.SEPARATOR_CHAR)+1);
+    return getScopedId().hashCode();
   }
-
+  
+  @Override
+  public final String toString()
+  {
+    return super.toString() + ":" + getScopedId();
+  }
+  
   /**
-   * Transform the <code>scopedIdList</code> of "important" component IDs to 
-   * generate the <code>scopedID</code> for the referenced <code>UIComponent</code>.
-   * 
-   * Uses the <code>scopedIdLength</code>
+   * Returns the scoped id for this ComponentReference
+   * @return
    */
-  private String _createScopedId(int scopedIdLength, List<String> scopedIdList)
-  {
-    StringBuilder builder = new StringBuilder(scopedIdLength);
-
-    for (int i = scopedIdList.size()-1; i >= 0 ; i--)
-    {
-      builder.append(scopedIdList.get(i));
+  protected abstract String getScopedId();
 
-      // if there are more IDs in the list, we need to append a colon
-      if (i > 0)
-      {
-        builder.append(NamingContainer.SEPARATOR_CHAR);
-      }
-    }
+  /**
+   * Returns the id of the Component that this ComponentReference points to
+   * @return
+   */
+  protected abstract String getComponentId();
 
-    // store the (final) scopedId
-    return builder.toString();
+  protected final void setComponentPath(List<Object> componentPath)
+  {
+    _componentPath = componentPath;
   }
 
   /**
@@ -171,53 +313,15 @@ public final class ComponentReference<T extends UIComponent> implements Serializ
    * To calculate the <code>scopedID</code> we add the ID of every <code>NamingContainer</code> that we hit,
    * while walking up the component tree, to the <code>scopedIdList</code>. 
    * 
-   * @param uicomponent The <code>UIComponent</code> for this current iteration
-   * @param scopedId , or null if neeed to build it
+   * @param component The <code>UIComponent</code> for this current iteration
    * 
-   * @see ComponentReference#newUIComponentReference()
+   * @see #newUIComponentReference
    */
-  private String _createComponentPathAndScopedId(UIComponent component, String scopedId)
+  protected static List<Object> calculateComponentPath(UIComponent component)
   {
     // setUp of list that stores information about the FACET name or the COMPONENT index
     List<Object> componentHierarchyList = new ArrayList<Object>();
 
-    // setUp of list that contains the IDs for all NamingContainers
-    // on the way up to the <code>UIViewRoot</code>
-    List<String> scopedIdList = null;
-
-    // extract the component Id and
-    // start to calculate its length... IF needed...
-    boolean needToCalculateScopedId = (scopedId == null);
-
-    int scopedIdLength = 0;
-    if (scopedId == null)
-    {
-      // store the id of the component as a transient field since we can grab it from the scoped id
-      // but want it available to validate the component we found from the path
-      String currCompId = component.getId();
-
-      if (currCompId == null)
-      {
-        //TODO i18n
-        throw new IllegalArgumentException("The UIComponent needs to have an ID");
-      }
-      else
-      {
-        _componentId = currCompId;
-      }
-
-      scopedIdList = new ArrayList<String>();
-      scopedIdLength += _componentId.length();
-      // add the ID of the given UIComponent to (the beginning of) the list
-      scopedIdList.add(_componentId);
-    }
-    else
-    {
-      // extract componentId from scopedId
-      _componentId = _calculateComponentIdFromScopedId(scopedId);
-    }
-
-
     // stash the component and parent , for the loop
     UIComponent currComponent = component;
     UIComponent currParent = currComponent.getParent();
@@ -225,28 +329,13 @@ public final class ComponentReference<T extends UIComponent> implements Serializ
     // enter the loop, if there is a parent for the current component
     while(currParent != null)
     {
-
-      // When current parent is a NamingContainer we want to scope the ID
-      // but ONLY if that has not been done (needToCalculateScopedId:true)
-      if (needToCalculateScopedId && (currParent instanceof NamingContainer))
-      {
-        // extract the parent-component Id and
-        // continue to calculate the final length of the scopedId
-        // the "+1" takes the SEPARATOR_CHAR into account
-        String namingContainerId = currParent.getId();
-        scopedIdLength += namingContainerId.length() + 1;  
-        // as we hit a NamingContainer we add its ID to
-        // the beginning of the "scopedId" list
-        scopedIdList.add(namingContainerId);
-      }
-      // end of scopedID business, for this call;
-
-
+      int childIndex = currParent.getChildren().indexOf(currComponent);
+      
       // is the given component a child of the parent?
-      if (currParent.getChildren().contains(currComponent))
+      if (childIndex != -1)
       {          
         // if so, add the INDEX (type: int) at the beginning of the list
-        componentHierarchyList.add(currParent.getChildren().indexOf(currComponent));
+        componentHierarchyList.add(childIndex);
       }
       else
       {
@@ -274,26 +363,118 @@ public final class ComponentReference<T extends UIComponent> implements Serializ
 
     // done with the loop as >currComponent< has no own parent. Which
     // means we must talk to <code>UIViewRoot</code> here.
-    // Otherwise the component is not connected to the tree,
-    // so we thrown an IllegalArgumentException
+    // Otherwise the component is not connected to the tree, but we should have already checked this
+    // before calling this function
     if (!(currComponent instanceof UIViewRoot))
+      throw new IllegalStateException(
+                   "The component " + component + " is NOT connected to the component tree");
+  
+    return componentHierarchyList;
+  }
+  
+  protected static String calculateScopedId(
+    UIComponent component,
+    String      componentId)
+  {
+    if (componentId == null)
+      throw new IllegalStateException("Can't create a ComponentReference for component " +
+                                      component +
+                                      " no id");    
+    int scopedIdLength = componentId.length();
+  
+    List<String> scopedIdList = new ArrayList<String>();
+   
+    // determine how many characters we need to store the scopedId.  We skip the component itself,
+    // because we have already accounted for its id
+    UIComponent currAncestor = component.getParent();
+    
+    while (currAncestor != null)
     {
-      //TODO i18n
-      throw new IllegalArgumentException("The component " + component + " is NOT connected to the component tree");
+      // add the sizes of all of the NamingContainer ancestors, plus 1 for each NamingContainer separator
+      if (currAncestor instanceof NamingContainer)
+      {
+        String currId = currAncestor.getId();
+        scopedIdLength += currId.length() + 1;
+      
+        // add the NamingContainer to the list of NamingContainers
+        scopedIdList.add(currId);
+      }
+      
+      currAncestor = currAncestor.getParent();
     }
+    
+    // now append all of the NamingContaintes
+    return _createScopedId(scopedIdLength, scopedIdList, componentId);
+  }
+
+  private Object writeReplace()
+  {
+    // Only use the proxy when Serializing
+    return new SerializationProxy(getScopedId());
+  }
+  
+  private void readObject(@SuppressWarnings("unused") ObjectInputStream stream) throws InvalidObjectException
+  {
+    // We can't be deserialized directly
+    throw new InvalidObjectException("Proxy required");
+  } 
 
-    // once we are done with loop to the UIViewRoot, the "componentHierarchyList" as our "component path"
-    _componentPath = componentHierarchyList;
+  /**
+   * Add a reference to the list of References that may need initialization later
+   * @param reference
+   */
+  private static void _addToEnsureInitializationList(ComponentReference<?> reference)
+  {
+    Map<String, Object> requestMap = 
+                            FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
     
-    // trigger the generation of the final scopedID
-    // OR return NULL (as we already have the scopedId
-    // when "needToCalculateScopedId" is false...
-    if (needToCalculateScopedId)
+    Collection<ComponentReference<?>> initializeList = (Collection<ComponentReference<?>>)
+                                             requestMap.get(_FINISH_INITIALIZATION_LIST_KEY);
+    
+    if (initializeList == null)
     {
-      scopedId = _createScopedId(scopedIdLength, scopedIdList);
+      initializeList = new ArrayList<ComponentReference<?>>();
+      requestMap.put(_FINISH_INITIALIZATION_LIST_KEY, initializeList);
     }
+    
+    initializeList.add(reference);
+  }
+
+  /**
+   * Transform the <code>scopedIdList</code> of "important" component IDs to 
+   * generate the <code>scopedID</code> for the referenced <code>UIComponent</code>.
+   * 
+   * Uses the <code>scopedIdLength</code>
+   */
+  private static String _createScopedId(int scopedIdLength, List<String> scopedIdList, String componentId)
+  {
+    StringBuilder builder = new StringBuilder(scopedIdLength);
+
+    for (int i = scopedIdList.size() - 1; i >= 0 ; i--)
+    {
+      builder.append(scopedIdList.get(i));
+      builder.append(NamingContainer.SEPARATOR_CHAR);
+    }
+
+    builder.append(componentId);
+    
+    // store the (final) scopedId
+    return builder.toString();
+  }
+  
+  protected static UIViewRoot getUIViewRoot(UIComponent component)
+  {
+    // stash the component and parent , for the loop
+    UIComponent currComponent = component;
+    UIComponent currParent = currComponent.getParent();
 
-    return scopedId;
+    while(currParent != null)
+    {
+      currComponent = currParent;
+      currParent = currParent.getParent();
+    }
+    
+    return (currComponent instanceof UIViewRoot) ? (UIViewRoot)currComponent : null;
   }
 
   /**
@@ -301,16 +482,16 @@ public final class ComponentReference<T extends UIComponent> implements Serializ
    * uses the <code>hierarchyInformationList</code> to check if the it needs to
    * walk into a FACET or an INDEX of the component.
    * 
-   * @see ComponentReference#_createComponentPathAndScopedId(UIComponent)
+   * @see ComponentReference#calculateComponentPath(UIComponent)
    */
-  private UIComponent _walkPathToComponent(UIViewRoot root, List<Object> hierarchyInformationList)
+  private UIComponent _walkPathToComponent(UIViewRoot root, List<Object> componentPath)
   {
     UIComponent currFound = root;
 
     // iterate backwards since we appending the items starting from the component
-    for (int i = hierarchyInformationList.size() - 1; i >= 0 ; i--)
+    for (int i = componentPath.size() - 1; i >= 0 ; i--)
     {
-      Object location = hierarchyInformationList.get(i);
+      Object location = componentPath.get(i);
 
       // integer means we need to get the kid at INDEX obj
       // but let's not try to lookup from a component with
@@ -347,9 +528,152 @@ public final class ComponentReference<T extends UIComponent> implements Serializ
     }
     return currFound;
   }
+  
+  /**
+   * ComponentReference where the scopedId is calculatable at creation time
+   */
+  private static final class StableComponentReference extends ComponentReference
+  {
+    private StableComponentReference(String scopedId)
+    {      
+      this(scopedId,
+           // String.substring() is optimized to return this if the entire string
+           // is the substring, so no further optimization is necessary
+           scopedId.substring(scopedId.lastIndexOf(NamingContainer.SEPARATOR_CHAR)+1),
+           null);
+    }
+ 
+    private StableComponentReference(
+      String scopedId,
+      String componentId,
+      List<Object> componentPath)
+    {
+      super(componentPath);
+
+      if (scopedId == null)
+        throw new NullPointerException();
+      
+      _scopedId = scopedId;
+      _componentId = componentId;
+    }
+    
+    public void ensureInitialization()
+    {
+      // do nothing--stable references are always fully initialized
+    }
+
+    protected String getScopedId()
+    {
+      return _scopedId;
+    }
+
+    protected String getComponentId()
+    {
+      return _componentId;
+    }
+ 
+    private final String _componentId;
+    private final String _scopedId;
+
+    private static final long serialVersionUID = 0L;
+  }
+  
+  /**
+   * ComponentReference where the component isn't ready to have its ComponentReference calculated at
+   * creation time.  Instead we wait until getComponent() is called, or the ComponentReference is
+   * Serialized.
+   */
+  private static final class DeferredComponentReference<T extends UIComponent> extends ComponentReference
+  {
+    /**
+     * Private constructor, used by <code>ComponentReference.newUIComponentReference</code> 
+     * @param component the <code>UIComponent</code> we want to store the path for
+     */
+    private DeferredComponentReference(T component)
+    {
+      super(null);
+      
+      // temporarily store away the component
+      _component = component;
+    }
+
+    public void ensureInitialization()
+    {
+      // getScopedId() ensures we are initialized
+      getScopedId();
+    }
+
+    protected String getScopedId()
+    {
+      String scopedId = _scopedId;
+      
+      // we have no scopedId, so calculate the scopedId and finish initializing
+      // the DeferredComponentReference
+      if (scopedId == null)
+      {
+        UIComponent component = _component;
+        
+        // need to check that component isn't null because of possible race condition if this
+        // method is called from different threads.  In that case, scopedId will have been filled
+        // in, so we can return it
+        if (component != null)
+        {
+          String componentId = component.getId();
+                    
+          scopedId = calculateScopedId(component, componentId);
+          _scopedId = scopedId;
+          _componentId = componentId;
+          
+          // store away our component path while we can efficiently calculate it
+          setComponentPath(calculateComponentPath(component));
+          
+          _component = null;
+        }
+        else
+        {
+          scopedId = _scopedId;
+        }
+      }
+      
+      return scopedId;
+    }
+
+    protected String getComponentId()
+    {
+      return _componentId;
+    }
+    
+    private transient T _component;
+    private transient volatile String _componentId;
+    private volatile String _scopedId;
+
+    private static final long serialVersionUID = 0L;
+  }
+
+  /**
+   * Proxy class for serializing ComponentReferences.  The Serialized for is simply the scopedId
+   */
+  private static final class SerializationProxy implements Serializable
+  {
+    SerializationProxy(String scopedId)
+    {
+      _scopedId = scopedId;
+    }
+
+    private Object readResolve()
+    {
+      return new StableComponentReference(_scopedId);
+    }
+      
+    private final String _scopedId;
+
+    private static final long serialVersionUID = 0L;
+  }
+
+  private transient volatile List<Object> _componentPath;
 
-  private transient List<Object> _componentPath;
-  private transient String _componentId;
-  private final String _scopedId;
+  private static final String _FINISH_INITIALIZATION_LIST_KEY = ComponentReference.class.getName() +
+                                                                "#FINISH_INITIALIZATION";
+  
   private static final long serialVersionUID = -6803949269368863899L;
 }
\ No newline at end of file
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
index f62c452..1558a6b 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
@@ -217,14 +217,17 @@ public class ComponentReferenceTest extends FacesTestCase
     // build the Tree...
     root.getChildren().add(input1);
 
+    ComponentReference ref = ComponentReference.newUIComponentReference(input1);
+
     // Get the ComponentReference util
     try
     {
-      ComponentReference.newUIComponentReference(input1);
+      ref.getComponent();
+      
       // find the component...
-      fail("IllegalArgumentException expected");
+      fail("IllegalStateException expected");
     }
-    catch (Exception e)
+    catch (IllegalStateException e)
     {
       // suppress it - this is as expected
     }
@@ -294,6 +297,38 @@ public class ComponentReferenceTest extends FacesTestCase
     assertNull(referencedComp);
   }
 
+  public void testDeferredMovingInsideNamingContainer()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+
+    // almost build the tree
+    nc1.getChildren().add(nc2);
+    nc2.getChildren().add(nc3);
+
+    // Get the ComponentReference util, this will be a deferred component reference since the
+    // component wasn't attached
+    ComponentReference<UINamingContainer> uiRef = ComponentReference.newUIComponentReference(nc3);
+
+    // now finish building the component tree
+    root.getChildren().add(nc1);
+
+    // find the component...
+    UINamingContainer referencedComp = uiRef.getComponent();
+    assertEquals(nc3, referencedComp);
+
+    // let's move the NC3 component one level up;
+    nc2.getChildren().remove(nc3);
+    nc1.getChildren().add(nc3);
+
+    // and we can not find the component...
+    referencedComp = uiRef.getComponent();
+    assertNull(referencedComp);
+  }
+
   public void testComponentNotInTree()
   {
     UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
@@ -305,13 +340,16 @@ public class ComponentReferenceTest extends FacesTestCase
     nc2.getChildren().add(nc3);
 
     // Get the ComponentReference util
+    ComponentReference ref = ComponentReference.newUIComponentReference(nc3);
+
     try
     {
-      ComponentReference.newUIComponentReference(nc3);
       // find the component...
-      fail("IllegalArgumentException expected");
+      ref.getComponent();
+      
+      fail("IllegalStateException expected");
     }
-    catch (Exception e)
+    catch (IllegalStateException e)
     {
       // suppress it - this is as expected
     }
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java
index d6da91c..005b0af 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java
@@ -19,6 +19,8 @@
 
 package org.apache.myfaces.trinidadinternal.config;
 
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -27,6 +29,8 @@ import java.util.concurrent.atomic.AtomicReference;
 
 import javax.faces.context.ExternalContext;
 
+import javax.faces.context.FacesContext;
+
 import javax.servlet.ServletRequest;
 
 import javax.servlet.ServletRequestWrapper;
@@ -40,6 +44,7 @@ import org.apache.myfaces.trinidad.context.RequestContextFactory;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.skin.SkinFactory;
 import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
+import org.apache.myfaces.trinidad.util.ComponentReference;
 import org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl;
 import org.apache.myfaces.trinidadinternal.context.external.ServletCookieMap;
 import org.apache.myfaces.trinidadinternal.context.external.ServletRequestHeaderMap;
@@ -409,7 +414,6 @@ public final class GlobalConfiguratorImpl
       }
       finally
       {
-
         //Do cleanup of anything which may have use the thread local manager durring
         //init.
         _releaseManagedThreadLocals();
@@ -480,12 +484,19 @@ public final class GlobalConfiguratorImpl
     RequestContext context = RequestContext.getCurrentInstance();
     if (context != null)
     {
+      // ensure that any deferred ComponentReferences are initialized
+      _finishComponentReferenceInitialization(ec);
+
       context.release();
       _releaseManagedThreadLocals();
+      
       assert RequestContext.getCurrentInstance() == null;
     }
   }
 
+  /**
+   * Ensure that any ThreadLocals initialized during this request are cleared
+   */
   private void _releaseManagedThreadLocals()
   {
     ThreadLocalResetter resetter = _threadResetter.get();
@@ -495,6 +506,29 @@ public final class GlobalConfiguratorImpl
       resetter.__removeThreadLocals();
     }
   }
+  
+  /**
+   * Ensure that all DeferredComponentReferences are fully initialized before the
+   * request completes
+   */
+  private void _finishComponentReferenceInitialization(ExternalContext ec)
+  {
+    Map<String, Object> requestMap = ec.getRequestMap();
+    
+    Collection<ComponentReference<?>> initializeList = (Collection<ComponentReference<?>>)
+                                             requestMap.get(_FINISH_INITIALIZATION_LIST_KEY);
+    
+    if ((initializeList != null) && !initializeList.isEmpty())
+    {
+      for (ComponentReference<?> reference : initializeList)
+      {
+        reference.ensureInitialization();
+      }
+      
+      // we've initialized everything, so we're done
+      initializeList.clear();
+    }
+  }
 
   private void _endConfiguratorServiceRequest(final ExternalContext ec)
   {
@@ -738,6 +772,10 @@ public final class GlobalConfiguratorImpl
     static private String _TEST_PARAM = TestRequest.class.getName() + ".TEST_PARAM";
   }
 
+  // skanky duplication of key from ComponentReference Class
+  private static final String _FINISH_INITIALIZATION_LIST_KEY = ComponentReference.class.getName() +
+                                                                "#FINISH_INITIALIZATION";
+
   // hacky reference to the ThreadLocalResetter used to clean up request-scoped
   // ThreadLocals
   private AtomicReference<ThreadLocalResetter> _threadResetter =

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 15/36: TRINIDAD-1676 - ha: provide facility to support putting uicompoenent references into the session

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 23b5c073ccad9a612d4d36b9825c93342c773746
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Tue Feb 9 08:28:41 2010 +0000

    TRINIDAD-1676 - ha: provide facility to support putting uicompoenent references into the session
---
 .../myfaces/trinidad/util/ComponentReference.java  | 355 ++++++++++++++
 .../trinidad/util/ComponentReferenceTest.java      | 519 +++++++++++++++++++++
 2 files changed, 874 insertions(+)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java
new file mode 100644
index 0000000..fa1a1cd
--- /dev/null
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ComponentReference.java
@@ -0,0 +1,355 @@
+/*
+ *  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.trinidad.util;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+/**
+ * A utility to store a reference to an <code>UIComponent</code>. Application developers
+ * should use this tool if they need to have a reference to an instance of the
+ * <code>UIComponent</code> class in <code>managed beans</code> that are <b>session scoped</b>.
+ * 
+ * Use <code>newUIComponentReference()</code> to create a <code>ComponentReference</code> and
+ * use the <code>getComponent()</code> to look up the referenced <code>UIComponent</code>.
+ * 
+ * <p><b>Please note:</b>
+ * <ul>
+ * <li>This class is <b>not</b> thread-safe, since it depends on <code>UIComponent</code> APIs.
+ * <li>The passed in <code>UIComponent</code> is <b>required</b> to have an <code>ID</code>
+ * <li>The reference will break if the <code>UIComponent</code> is moved between <code>NamingContainer</code>s <b>or</b>
+ * if any of the ancestor <code>NamingContainer</code>s have their IDs changed.
+ * <li>The refrence is persistable. <b>However</b> <code>UIComponent</code>s are not <code>Serializable</code> and therefore
+ * can not be used at any scope longer than request.
+ * 
+ * </ul>
+ * 
+ * @see ComponentReference#newUIComponentReference(UIComponent)
+ * @see ComponentReference#getComponent()
+ */
+public final class ComponentReference<T extends UIComponent> implements Serializable
+{
+  /**
+   * Private constructor, used by <code>ComponentReference.newUIComponentReference</code> 
+   * @param uicomponent the <code>UIComponent</code> we want to store the path for
+   */
+  private ComponentReference(T uicomponent)
+  {
+    // create the "component path" to remember the position of the uicomponent and begin
+    // the work to figureout the scopedID
+    _scopedId = _createComponentPathAndScopedId(uicomponent, null);
+  }
+
+  /**
+   * Factory method to create an instance of the <code>ComponentReference</code> class, which wraps the given
+   * <code>UIComponent</code>. The component must be in the component tree when this method
+   * is called and that we will throw an <code>IllegalArgumentException</code> if it is not.
+   * 
+   * @param uicomponent the <code>UIComponent</code> to wrap.
+   * @throws IllegalArgumentException if component is not in the component tree
+   * @throws IllegalArgumentException if component does <b>not</b> have an <code>Id</code>
+   * @return <code>ComponentReference</code> that wrap the given component
+   */
+  public static <T extends UIComponent> ComponentReference<T> newUIComponentReference(T uicomponent)
+  {
+    return new ComponentReference<T>(uicomponent);
+  }
+
+  /**
+   * This method will use a calculated "component path" to walk down to the <code>UIComponent</code>
+   * that is referenced by this class. If the component can not be found, the <code>getComponent()</code>
+   * will return <code>null</code>. 
+   * 
+   * @return the referenced <code>UIComponent</code> or <code>null</code> if it can not be found.
+   * @see ComponentReference#newUIComponentReference(UIComponent)
+   */
+  @SuppressWarnings("unchecked")
+  public T getComponent()
+  {
+    UIComponent foundComponent = null;
+
+    // In order to find the component with its
+    // calculated path, we need to start at the ViewRoot;
+    UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
+
+
+    if (_componentPath != null) 
+    {
+      // Walk down the component tree, to the component we are looking for.
+      // We start at the ViewRoot and use the previous calculated "component path"
+      foundComponent = _walkPathToComponent(root, _componentPath);
+    }
+
+    // Check if we really found it with the previously created "component path"
+    if (foundComponent == null || (!_componentId.equals(foundComponent.getId())))
+    {
+      // OK, we were not luck with the calculated "component path", let's
+      // see if we can find it by using the "scoped ID" and the regular 
+      // findComponent();
+      foundComponent = root.findComponent(_scopedId);
+
+      // was the regular findComponent() successful ?
+      if (foundComponent != null)
+      {        
+        // OK, now let's rebuild the path
+        _createComponentPathAndScopedId(foundComponent, _scopedId);
+      }
+    }
+
+    return (T) foundComponent;
+  }
+
+  /**
+   * Utility to (re) create the component Id from the <code>_scopedId</code>.
+   * 
+   * @return the extracted <code>UIComponentId</code>
+   */
+  private String _calculateComponentIdFromScopedId(String scopedId)
+  {
+    // String.substring() is optimized to return this if the entire string
+    // is the substring so that no one tries to optimize it later
+    return scopedId.substring(scopedId.lastIndexOf(NamingContainer.SEPARATOR_CHAR)+1);
+  }
+
+  /**
+   * Transform the <code>scopedIdList</code> of "important" component IDs to 
+   * generate the <code>scopedID</code> for the referenced <code>UIComponent</code>.
+   * 
+   * Uses the <code>scopedIdLength</code>
+   */
+  private String _createScopedId(int scopedIdLength, List<String> scopedIdList)
+  {
+    StringBuilder builder = new StringBuilder(scopedIdLength);
+
+    for (int i = scopedIdList.size()-1; i >= 0 ; i--)
+    {
+      builder.append(scopedIdList.get(i));
+
+      // if there are more IDs in the list, we need to append a colon
+      if (i > 0)
+      {
+        builder.append(NamingContainer.SEPARATOR_CHAR);
+      }
+    }
+
+    // store the (final) scopedId
+    return builder.toString();
+  }
+
+  /**
+   * Creates the "component path" started by the given <code>UIComponent</code> up the <code>UIViewRoot</code>
+   * of the underlying component tree. The hierarchy is stored in a <code>List</code> of <code>Object</code>s
+   * (the <code>componentHierarchyList</code> parameter). If the given <code>UIComponent</code> is nested in a 
+   * <code>Facet</code> of a <code>UIComponent</code>, we store the name of the actual <code>facet</code> in
+   * the list. If it is a regular child, we store its position/index. 
+   * 
+   * <p> 
+   * To calculate the <code>scopedID</code> we add the ID of every <code>NamingContainer</code> that we hit,
+   * while walking up the component tree, to the <code>scopedIdList</code>. 
+   * 
+   * @param uicomponent The <code>UIComponent</code> for this current iteration
+   * @param scopedId , or null if neeed to build it
+   * 
+   * @see ComponentReference#newUIComponentReference()
+   */
+  private String _createComponentPathAndScopedId(UIComponent component, String scopedId)
+  {
+    // setUp of list that stores information about the FACET name or the COMPONENT index
+    List<Object> componentHierarchyList = new ArrayList<Object>();
+
+    // setUp of list that contains the IDs for all NamingContainers
+    // on the way up to the <code>UIViewRoot</code>
+    List<String> scopedIdList = null;
+
+    // extract the component Id and
+    // start to calculate its length... IF needed...
+    boolean needToCalculateScopedId = (scopedId == null);
+
+    int scopedIdLength = 0;
+    if (scopedId == null)
+    {
+      // store the id of the component as a transient field since we can grab it from the scoped id
+      // but want it available to validate the component we found from the path
+      String currCompId = component.getId();
+
+      if (currCompId == null)
+      {
+        //TODO i18n
+        throw new IllegalArgumentException("The UIComponent needs to have an ID");
+      }
+      else
+      {
+        _componentId = currCompId;
+      }
+
+      scopedIdList = new ArrayList<String>();
+      scopedIdLength += _componentId.length();
+      // add the ID of the given UIComponent to (the beginning of) the list
+      scopedIdList.add(_componentId);
+    }
+    else
+    {
+      // extract componentId from scopedId
+      _componentId = _calculateComponentIdFromScopedId(scopedId);
+    }
+
+
+    // stash the component and parent , for the loop
+    UIComponent currComponent = component;
+    UIComponent currParent = currComponent.getParent();
+
+    // enter the loop, if there is a parent for the current component
+    while(currParent != null)
+    {
+
+      // When current parent is a NamingContainer we want to scope the ID
+      // but ONLY if that has not been done (needToCalculateScopedId:true)
+      if (needToCalculateScopedId && (currParent instanceof NamingContainer))
+      {
+        // extract the parent-component Id and
+        // continue to calculate the final length of the scopedId
+        // the "+1" takes the SEPARATOR_CHAR into account
+        String namingContainerId = currParent.getId();
+        scopedIdLength += namingContainerId.length() + 1;  
+        // as we hit a NamingContainer we add its ID to
+        // the beginning of the "scopedId" list
+        scopedIdList.add(namingContainerId);
+      }
+      // end of scopedID business, for this call;
+
+
+      // is the given component a child of the parent?
+      if (currParent.getChildren().contains(currComponent))
+      {          
+        // if so, add the INDEX (type: int) at the beginning of the list
+        componentHierarchyList.add(currParent.getChildren().indexOf(currComponent));
+      }
+      else
+      {
+        // If the component is not a child, it must be a facet.
+        // When the component is nested in a facet, we need to find
+        // the name of the embedding FACET
+        Set<Map.Entry<String, UIComponent>> entries = currParent.getFacets().entrySet();
+        for(Map.Entry<String, UIComponent> entry : entries)
+        {
+          if (currComponent.equals(entry.getValue()))
+          {
+            // once we identified the actual component/facet,
+            // we store the name (type: String)at the
+            // beginning of the list and quite the loop afterwards
+            componentHierarchyList.add(entry.getKey());
+            break;
+          }
+        }
+      }
+
+      // set references for the next round of the loop
+      currComponent = currParent;
+      currParent = currParent.getParent();
+    }
+
+    // done with the loop as >currComponent< has no own parent. Which
+    // means we must talk to <code>UIViewRoot</code> here.
+    // Otherwise the component is not connected to the tree,
+    // so we thrown an IllegalArgumentException
+    if (!(currComponent instanceof UIViewRoot))
+    {
+      //TODO i18n
+      throw new IllegalArgumentException("The component " + component + " is NOT connected to the component tree");
+    }
+
+    // once we are done with loop to the UIViewRoot, the "componentHierarchyList" as our "component path"
+    _componentPath = componentHierarchyList;
+    
+    // trigger the generation of the final scopedID
+    // OR return NULL (as we already have the scopedId
+    // when "needToCalculateScopedId" is false...
+    if (needToCalculateScopedId)
+    {
+      scopedId = _createScopedId(scopedIdLength, scopedIdList);
+    }
+
+    return scopedId;
+  }
+
+  /**
+   * Starts to walk down the component tree by the given <code>UIViewRoot</code>. It
+   * uses the <code>hierarchyInformationList</code> to check if the it needs to
+   * walk into a FACET or an INDEX of the component.
+   * 
+   * @see ComponentReference#_createComponentPathAndScopedId(UIComponent)
+   */
+  private UIComponent _walkPathToComponent(UIViewRoot root, List<Object> hierarchyInformationList)
+  {
+    UIComponent currFound = root;
+
+    // iterate backwards since we appending the items starting from the component
+    for (int i = hierarchyInformationList.size() - 1; i >= 0 ; i--)
+    {
+      Object location = hierarchyInformationList.get(i);
+
+      // integer means we need to get the kid at INDEX obj
+      // but let's not try to lookup from a component with
+      // no kids
+      if (location instanceof Integer)
+      {
+        int childIndex = ((Integer)location).intValue();
+        
+        List<UIComponent> children = currFound.getChildren();
+
+        // make sure there is actually a child at this index
+        if (childIndex < children.size())
+        {
+          currFound = children.get(childIndex);
+        }
+        else
+        {
+          // something changed, there aren't enough children so give up
+          return null;
+        }
+      }
+      else
+      {
+        // there is only ONE child per facet! So get the
+        // component of FACET "obj"
+        String facetName = location.toString();
+
+        currFound = currFound.getFacets().get(facetName);
+
+        // component isn't under the same facet anymore, so give up
+        if (currFound == null)
+          return null;
+      }
+    }
+    return currFound;
+  }
+
+  private transient List<Object> _componentPath;
+  private transient String _componentId;
+  private final String _scopedId;
+  private static final long serialVersionUID = -6803949269368863899L;
+}
\ No newline at end of file
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
new file mode 100644
index 0000000..f7ad481
--- /dev/null
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/util/ComponentReferenceTest.java
@@ -0,0 +1,519 @@
+/*
+ *  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.trinidad.util;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import javax.faces.component.UIData;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIInput;
+import javax.faces.component.UINamingContainer;
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIPanel;
+import javax.faces.component.UIViewRoot;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.myfaces.trinidadbuild.test.FacesTestCase;
+
+public class ComponentReferenceTest extends FacesTestCase
+{
+  public static final Test suite()
+  {
+    return new TestSuite(ComponentReferenceTest.class);
+  }
+  
+  public static void main(String[] args) throws Throwable
+  {
+    junit.textui.TestRunner.run(suite());
+  }
+
+  public ComponentReferenceTest(
+    String testName)
+  {
+    super(testName);
+  }
+  
+  public void testVerySimpleFinder()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UIInput input1 = new UIInput(); input1.setId("input1");
+
+    // build the Tree...
+    root.getChildren().add(input1);
+
+    // Get the ComponentReference util
+    ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input1);
+
+    // find the component...
+    UIInput referencedComp = uiRef.getComponent();
+
+    assertEquals(input1, referencedComp);
+  }
+
+  @SuppressWarnings("unchecked")
+  public void testFailoverOnCustomFacet()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UIForm form = new UIForm(); form.setId("form");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+    UIPanel panel = new UIPanel(); panel.setId("panel");
+    UIInput input = new UIInput(); input.setId("input1");
+
+    // build the Tree...
+    panel.getFacets().put("fancyFacet", input);
+    nc3.getChildren().add(panel);
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(nc3);
+    nc1.getChildren().add(nc2);
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(nc1);
+    root.getChildren().add(new UIOutput());
+    root.getChildren().add(form);
+
+    // Get the ComponentReference util
+    ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input);
+
+    // find the component...
+    UIInput referencedComp = uiRef.getComponent();
+    assertEquals(input, referencedComp);
+    
+    // find it again!
+    assertEquals(input, uiRef.getComponent());
+    // fake the failover
+
+    try 
+    {
+      FileOutputStream fos = new FileOutputStream("t.tmp");
+      ObjectOutputStream oos = new ObjectOutputStream(fos);
+
+      oos.writeObject(uiRef);
+
+      FileInputStream fis = new FileInputStream("t.tmp");
+      ObjectInputStream ois = new ObjectInputStream(fis);
+
+      uiRef = (ComponentReference<UIInput>) ois.readObject();
+
+      referencedComp = uiRef.getComponent();
+      assertEquals(input, referencedComp);
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+    }
+  }
+
+  
+  @SuppressWarnings("unchecked")
+  public void testFailover()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UIInput input1 = new UIInput(); input1.setId("input1");
+
+    // build the Tree...
+    root.getChildren().add(input1);
+
+    // Get the ComponentReference util
+    ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input1);
+
+    // find the component...
+    UIInput referencedComp = uiRef.getComponent();
+    assertEquals(input1, referencedComp);
+    
+    // fake the failover
+    try 
+    {
+      FileOutputStream fos = new FileOutputStream("t.tmp");
+      ObjectOutputStream oos = new ObjectOutputStream(fos);
+
+      oos.writeObject(uiRef);
+
+      FileInputStream fis = new FileInputStream("t.tmp");
+      ObjectInputStream ois = new ObjectInputStream(fis);
+
+      uiRef = (ComponentReference<UIInput>) ois.readObject();
+
+      referencedComp = uiRef.getComponent();
+      assertEquals(input1, referencedComp);
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+    }
+    
+  }
+
+  public void testEmptyViewRootOnGetComponent()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+
+    // build the tree
+    root.getChildren().add(nc1);
+    nc1.getChildren().add(nc2);
+    nc2.getChildren().add(nc3);
+
+    // Get the ComponentReference util
+    ComponentReference<UINamingContainer> uiRef = ComponentReference.newUIComponentReference(nc3);
+
+    // find the component...
+    UINamingContainer referencedComp = uiRef.getComponent();
+
+    assertEquals(nc3, referencedComp);
+
+    // clear the ViewRoot
+    root.getChildren().clear();
+
+    // now, the getComponent should return NULL
+    assertNull(uiRef.getComponent());
+  }
+
+  public void testNoComponentWithoutAnId()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UIInput input1 = new UIInput();
+
+    // build the Tree...
+    root.getChildren().add(input1);
+
+    // Get the ComponentReference util
+    try
+    {
+      ComponentReference.newUIComponentReference(input1);
+      // find the component...
+      fail("IllegalArgumentException expected");
+    }
+    catch (Exception e)
+    {
+      // suppress it - this is as expected
+    }
+  }
+
+  public void testViewRoot()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+
+    // Get the ComponentReference util
+    ComponentReference<UIViewRoot> uiRef = ComponentReference.newUIComponentReference(root);
+
+    // find the component...
+    UIViewRoot referencedComp = uiRef.getComponent();
+    assertEquals(root, referencedComp);
+  }
+
+  public void testNamingContainerViewRoot()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+
+    // build the tree
+    root.getChildren().add(nc1);
+    nc1.getChildren().add(nc2);
+    nc2.getChildren().add(nc3);
+
+    // Get the ComponentReference util
+    ComponentReference<UINamingContainer> uiRef = ComponentReference.newUIComponentReference(nc3);
+
+    // find the component...
+    UINamingContainer referencedComp = uiRef.getComponent();
+
+    assertEquals(nc3, referencedComp);
+  }
+
+  public void testMovingInsideNamingContainer()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+
+    // build the tree
+    root.getChildren().add(nc1);
+    nc1.getChildren().add(nc2);
+    nc2.getChildren().add(nc3);
+
+    // Get the ComponentReference util
+    ComponentReference<UINamingContainer> uiRef = ComponentReference.newUIComponentReference(nc3);
+
+    // find the component...
+    UINamingContainer referencedComp = uiRef.getComponent();
+    assertEquals(nc3, referencedComp);
+
+    // let's move the NC3 component one level up;
+    nc2.getChildren().remove(nc3);
+    nc1.getChildren().add(nc3);
+
+    // and we can not find the component...
+    referencedComp = uiRef.getComponent();
+    assertNull(referencedComp);
+  }
+
+  public void testComponentNotInTree()
+  {
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+
+    // build the tree
+    nc1.getChildren().add(nc2);
+    nc2.getChildren().add(nc3);
+
+    // Get the ComponentReference util
+    try
+    {
+      ComponentReference.newUIComponentReference(nc3);
+      // find the component...
+      fail("IllegalArgumentException expected");
+    }
+    catch (Exception e)
+    {
+      // suppress it - this is as expected
+    }
+  }
+
+  public void testFindInPanelComponents()
+  {
+    UIViewRoot root = facesContext.getViewRoot(); root.setId("root");
+    UIPanel panel1 = new UIPanel(); panel1.setId("panel1");
+    UIPanel panel2 = new UIPanel(); panel2.setId("panel2");
+    UIPanel panel3 = new UIPanel(); panel3.setId("panel3");
+    UIOutput txt = new UIOutput(); txt.setId("txt");
+
+    // build the Tree...
+    root.getChildren().add(panel1);
+    panel1.getChildren().add(panel2);
+    panel2.getChildren().add(panel3);
+    panel3.getChildren().add(txt);
+
+    // Get the ComponentReference util
+    ComponentReference<UIOutput> uiRef = ComponentReference.newUIComponentReference(txt);
+
+    // find the component...
+    UIOutput referencedComp = uiRef.getComponent();
+
+    assertEquals(txt, referencedComp);
+  }
+
+  public void testCustomFacet()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UIForm form = new UIForm(); form.setId("form");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+    UIPanel panel = new UIPanel(); panel.setId("panel");
+    UIInput input = new UIInput(); input.setId("input1");
+
+    // build the Tree...
+    panel.getFacets().put("fancyFacet", input);
+    nc3.getChildren().add(panel);
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(nc3);
+    nc1.getChildren().add(nc2);
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(nc1);
+    root.getChildren().add(new UIOutput());
+    root.getChildren().add(form);
+
+    // Get the ComponentReference util
+    ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input);
+
+    // find the component...
+    UIInput referencedComp = uiRef.getComponent();
+    assertEquals(input, referencedComp);
+    
+    // find it again!
+    assertEquals(input, uiRef.getComponent());
+  }
+
+  public void testMoreFacets()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UIForm form = new UIForm(); form.setId("form");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+    UIPanel panel = new UIPanel(); panel.setId("panel");
+    UIInput input = new UIInput(); input.setId("input1");
+
+    // build the Tree...
+    panel.getFacets().put("f1", new UIOutput());
+    panel.getFacets().put("f2", new UIOutput());
+    panel.getFacets().put("f3", new UIOutput());
+    panel.getFacets().put("f4", new UIOutput());
+    panel.getFacets().put("f5", new UIOutput());
+
+    // add the important facet
+    panel.getFacets().put("f0", input);
+
+    nc3.getChildren().add(panel);
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(nc3);
+    nc1.getChildren().add(nc2);
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(nc1);
+    root.getChildren().add(new UIOutput());
+    root.getChildren().add(form);
+
+    // Get the ComponentReference util
+    ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input);
+
+    // find the component...
+    UIInput referencedComp = uiRef.getComponent();
+    assertEquals(input, referencedComp);
+    
+    // find it again!
+    assertEquals(input, uiRef.getComponent());
+  }
+
+  public void testCustomFacetWithFind()
+  {
+    UIViewRoot root = new UIViewRoot();
+    root.setId("root");
+    UIForm form = new UIForm(); form.setId("form");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+    UIPanel panel = new UIPanel(); panel.setId("panel");
+    UIInput input = new UIInput(); input.setId("input1");
+
+    // build the Tree...
+    panel.getFacets().put("fancyFacet", input);
+    panel.getChildren().add(input);
+    nc3.getChildren().add(panel);
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(nc3);
+    nc1.getChildren().add(nc2);
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(nc1);
+    root.getChildren().add(new UIOutput());
+    root.getChildren().add(form);
+    
+    facesContext.setViewRoot(root);
+
+    // Get the ComponentReference util
+    ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input);
+
+    // find the component...
+    UIInput referencedComp = uiRef.getComponent();
+    assertEquals(input, referencedComp);
+
+    // find it again!
+    assertEquals(input, uiRef.getComponent());
+
+  }
+  
+  public void testUIDataFooterFacet()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UIForm form = new UIForm(); form.setId("form");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+    UIData table = new UIData(); table.setId("table1");
+    UIInput input = new UIInput(); input.setId("input1");
+
+    // build the Tree...
+    table.setFooter(input);
+    nc3.getChildren().add(table);
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(nc3);
+    nc1.getChildren().add(nc2);
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(nc1);
+    root.getChildren().add(new UIOutput());
+    root.getChildren().add(form);
+
+    // Get the ComponentReference util
+    ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input);
+
+    // find the component...
+    UIInput referencedComp = uiRef.getComponent();
+
+    assertEquals(input, referencedComp);
+  }
+
+  public void testIndex()
+  {
+    UIViewRoot root = facesContext.getViewRoot();
+    root.setId("root");
+    UIForm form = new UIForm(); form.setId("form");
+    UINamingContainer nc1 = new UINamingContainer(); nc1.setId("nc1");
+    UINamingContainer nc2 = new UINamingContainer(); nc2.setId("nc2");
+    UINamingContainer nc3 = new UINamingContainer(); nc3.setId("nc3");
+    UIInput input1 = new UIInput(); input1.setId("input1");
+
+    // build the Tree...
+    nc3.getChildren().add(input1);
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(new UIOutput());
+    nc2.getChildren().add(nc3);
+    nc1.getChildren().add(nc2);
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(new UIOutput());
+    form.getChildren().add(nc1);
+    root.getChildren().add(new UIOutput());
+    root.getChildren().add(form);
+
+    // Get the ComponentReference util
+    ComponentReference<UIInput> uiRef = ComponentReference.newUIComponentReference(input1);
+
+    // find the component...
+    UIInput referencedComp = uiRef.getComponent();
+
+    assertEquals(input1, referencedComp);
+  }
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 22/36: TRINIDAD-1738 - prevent infinite recursion by keeping a set of visited components, ensuring that each component is only visited once during a partialUpdateNotify call

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit fcc5b781ac38f778f8026a2b3b1d85a107549740
Author: Andrew Robinson <ar...@apache.org>
AuthorDate: Wed Feb 24 20:22:49 2010 +0000

    TRINIDAD-1738 - prevent infinite recursion by keeping a set of visited components, ensuring that each component is only visited once during a partialUpdateNotify call
---
 .../context/RequestContextImpl.java                | 25 +++++++++++-----------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
index c8811fe..b3179e5 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
@@ -615,7 +615,7 @@ public class RequestContextImpl extends RequestContext
       // _addTargets(_GLOBAL_TRIGGER);
 
       // now do all listeners
-      _addTargets(updated);
+      _addTargets(updated, new HashSet<UIComponent>());
     }
   }
 
@@ -787,27 +787,28 @@ public class RequestContextImpl extends RequestContext
     return lifetimeObj.intValue();
   }
 
-  private void _addTargets(UIComponent key)
+  private void _addTargets(
+    UIComponent      key,
+    Set<UIComponent> visitedComponents)
   {
     Map<UIComponent, Set<UIComponent>> pl = _getPartialListeners();
     Set<UIComponent> listeners = pl.get(key);
-    if (listeners != null)
+    if (listeners != null && !listeners.isEmpty())
     {
-      // protect from infinite recursion
-      pl.remove(key);
+      // protect from infinite recursion by making sure we do not
+      // process the same component twice
+      if (!visitedComponents.add(key))
+      {
+        return;
+      }
 
-      for(UIComponent listener : listeners)
+      for (UIComponent listener : listeners)
       {
         addPartialTarget(listener);
         // This target will be re-rendered, re-render anything that's
         // listening on it also.
-        partialUpdateNotify(listener);
+        _addTargets(listener, visitedComponents);
       }
-      
-      // TRINIDAD-1545
-      // Re-add listeners to the map to accommodate partial targets for different stamps of 
-      // the same component
-      pl.put(key, listeners);
     }
   }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 10/36: add a FINE and a FINEST log message to SkinStyleProvider and FileSystemStyleCache. This can be turned on to monitor when we create a new SkinStyleProvider object and when we create a FileSystemStyleCache Key.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit f680255519eee64f062c75a8daaa76dfb237896c
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Fri Jan 22 00:21:30 2010 +0000

    add a FINE and a FINEST log message to SkinStyleProvider and FileSystemStyleCache. This can be turned on to monitor when we create a new SkinStyleProvider object and when we create a FileSystemStyleCache Key.
---
 .../org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java  | 5 +++++
 .../myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java   | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java
index c76d218..91817a9 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleProvider.java
@@ -95,6 +95,11 @@ public class SkinStyleProvider extends FileSystemStyleCache
         // yet, try creating it now.
         provider = new SkinStyleProvider(skin,
                                          targetDirectoryPath);
+        if (_LOG.isFine())
+        {
+          _LOG.fine("Create a new SkinStyleProvider for skin {0} and targetDirectoryPath {1}", 
+                    new Object[]{skin.getId(), targetDirectoryPath});
+        }
 
         // Store the provider in our cache
         providers.put(key, provider);
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
index ef9bad1..518ea8d 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
@@ -339,6 +339,10 @@ public class FileSystemStyleCache implements StyleProvider
     // The Key class is a private static class that is used for hashing. It implements
     // hashCode and equals which are based on locale, direction, browser, version, platform.
     Key key = new Key(context);
+    if (_LOG.isFinest())
+    {
+      _LOG.finest("FileSystemStyleCache's Key's hashCode is ", key.hashCode());
+    }
     Entry entry = _getEntry(cache, key, checkModified);
     if (entry != null)
       return entry;

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 09/36: TRINIDAD-1690

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit a5ff7f84e269b7f6355c64d5cc2009d3cef39a51
Author: Andrew Robinson <ar...@apache.org>
AuthorDate: Thu Jan 21 23:03:14 2010 +0000

    TRINIDAD-1690
---
 .../myfaces/trinidad/resource/ResourceLoader.java  | 56 ++++++++++++++--------
 .../myfaces/trinidad/webapp/ResourceServlet.java   | 36 ++++++++------
 2 files changed, 56 insertions(+), 36 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/resource/ResourceLoader.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/resource/ResourceLoader.java
index d029213..97f64db 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/resource/ResourceLoader.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/resource/ResourceLoader.java
@@ -6,9 +6,9 @@
  *  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
@@ -21,11 +21,11 @@ package org.apache.myfaces.trinidad.resource;
 import java.io.IOException;
 
 import java.net.URL;
-
 import java.net.URLConnection;
 
+
 /**
- * Base class for resource loaders.  Resource loaders can lookup resources 
+ * Base class for resource loaders.  Resource loaders can lookup resources
  * as URLs from arbitrary locations, including JAR files.
  *
  */
@@ -33,14 +33,14 @@ public class ResourceLoader
 {
   /**
    * Returns the shared resource loader that always returns null.
-   * 
+   *
    * @return null for any resource path
    */
   public static ResourceLoader getNullResourceLoader()
   {
     return _NULL_RESOURCE_LOADER;
   }
-  
+
   /**
    * Finds the resource with the given name.  A resource is some data
    * (images, audio, text, etc) that can be accessed by class code in a way
@@ -50,7 +50,7 @@ public class ResourceLoader
    * identifies the resource.
    *
    * <p> This method will first search the this resource loader for the
-   * resource.  That failing, this method will invoke 
+   * resource.  That failing, this method will invoke
    * {@link #findResource(String)} to on the parent resource loader to
    * find the resource.  </p>
    *
@@ -65,22 +65,22 @@ public class ResourceLoader
     ) throws IOException
   {
     URL url = findResource(name);
-    
-    if (url == null && _parent != null) 
+
+    if (url == null && _parent != null)
     {
       url = _parent.getResource(name);
     }
-    
+
     return url;
   }
-  
+
   /**
    * Returns whether a resource is cachable.
    * @return
    */
   public boolean isCachable()
   {
-    return _parent == null || _parent.isCachable(); 
+    return _parent == null || _parent.isCachable();
   }
 
   /**
@@ -99,32 +99,46 @@ public class ResourceLoader
   {
   	return null;
   }
-  
+
+  /**
+   * Called by the {@link org.apache.myfaces.trinidad.webapp.ResourceServlet} to get the content type for
+   * the given connection.
+   *
+   * @param loader the loader that provided the URL for the URL connection
+   * @param conn the URL connection
+   * @return the content type for this URL connection
+   */
+  public static String getContentType(
+    ResourceLoader loader,
+    URLConnection  conn)
+  {
+    return loader.getContentType(conn);
+  }
+
   /**
    * Returns the content type of this URL connection.
-   * 
-   * @return  the content type
+   * @return the content type
    */
   protected String getContentType(
     URLConnection conn)
   {
     return conn.getContentType();
   }
-  
+
   /**
-   * Returns the parent resource loader, or null if this is a root 
+   * Returns the parent resource loader, or null if this is a root
    * resource loader.
-   * 
+   *
    * @return  the parent resource loader
    */
   protected ResourceLoader getParent()
   {
     return _parent;
   }
-  
+
   /**
    * Constructs a new resource loader with specified parent resource loader.
-   * 
+   *
    * @param parent  the parent resource loader
    */
   protected ResourceLoader(
@@ -141,7 +155,7 @@ public class ResourceLoader
     this(null);
   }
 
-  private static final ResourceLoader _NULL_RESOURCE_LOADER = 
+  private static final ResourceLoader _NULL_RESOURCE_LOADER =
                                                       new ResourceLoader();
 
   private final ResourceLoader _parent;
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
index 4f13f52..bfc2636 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
@@ -6,9 +6,9 @@
  *  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
@@ -26,11 +26,14 @@ import java.io.InputStreamReader;
 import java.io.InterruptedIOException;
 import java.io.OutputStream;
 import java.io.Reader;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
+
 import java.net.SocketException;
 import java.net.URL;
 import java.net.URLConnection;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -40,6 +43,7 @@ import javax.faces.context.FacesContext;
 import javax.faces.context.FacesContextFactory;
 import javax.faces.event.PhaseListener;
 import javax.faces.lifecycle.Lifecycle;
+
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
@@ -57,6 +61,7 @@ import org.apache.myfaces.trinidad.resource.ResourceLoader;
 import org.apache.myfaces.trinidad.resource.ServletContextResourceLoader;
 import org.apache.myfaces.trinidad.util.URLUtils;
 
+
 /**
  * A Servlet which serves up web application resources (images, style sheets,
  * JavaScript libraries) by delegating to a ResourceLoader.
@@ -78,10 +83,10 @@ import org.apache.myfaces.trinidad.util.URLUtils;
 public class ResourceServlet extends HttpServlet
 {
   /**
-   * 
+   *
    */
   private static final long serialVersionUID = 4547362994406585148L;
-  
+
   /**
    * Override of Servlet.destroy();
    */
@@ -94,7 +99,7 @@ public class ResourceServlet extends HttpServlet
 
     super.destroy();
   }
-  
+
   /**
    * Override of Servlet.init();
    */
@@ -150,7 +155,7 @@ public class ResourceServlet extends HttpServlet
     else
     {
       Configurator.disableConfiguratorServices(request);
-    
+
       //=-= Scott O'Bryan =-=
       // Be careful.  This can be wrapped by other things even though it's meant to be a
       // Trinidad only resource call.
@@ -204,7 +209,7 @@ public class ResourceServlet extends HttpServlet
     connection.setDoInput(true);
     connection.setDoOutput(false);
 
-    _setHeaders(connection, response);
+    _setHeaders(connection, response, loader);
 
     InputStream in = connection.getInputStream();
     OutputStream out = response.getOutputStream();
@@ -416,11 +421,12 @@ public class ResourceServlet extends HttpServlet
    */
   private void _setHeaders(
     URLConnection       connection,
-    HttpServletResponse response)
+    HttpServletResponse response,
+    ResourceLoader      loader)
   {
     String resourcePath;
     URL    url;
-    String contentType  = connection.getContentType();
+    String contentType  = ResourceLoader.getContentType(loader, connection);
 
     if (contentType == null || "content/unknown".equals(contentType))
     {
@@ -437,26 +443,26 @@ public class ResourceServlet extends HttpServlet
       else
         contentType = getServletContext().getMimeType(resourcePath);
 
-      // The resource has an file extension we have not 
+      // The resource has an file extension we have not
       // included in the case statement above
       if (contentType == null)
       {
-        _LOG.warning("ResourceServlet._setHeaders(): " +  
+        _LOG.warning("ResourceServlet._setHeaders(): " +
                      "Content type for {0} is NULL!\n" +
                      "Cause: Unknown file extension",
                      resourcePath);
       }
     }
-    
+
     if (contentType != null)
     {
-      response.setContentType(contentType);    
+      response.setContentType(contentType);
       int contentLength = connection.getContentLength();
 
       if (contentLength >= 0)
         response.setContentLength(contentLength);
     }
-    
+
     long lastModified;
     try
     {
@@ -556,7 +562,7 @@ public class ResourceServlet extends HttpServlet
   // cutting back just to be safe.)
   public static final long ONE_YEAR_MILLIS = 31363200000L;
 
-  
+
   private static final Class[] _DECORATOR_SIGNATURE =
                                   new Class[]{ResourceLoader.class};
 

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 30/36: TRINIDAD-1746 move InputStreamProvider to be a public API also move NameResolver to be public.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit a4d1cbe4252c4f2344e69ed6505e498c72c61631
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Mar 9 21:13:56 2010 +0000

    TRINIDAD-1746 move InputStreamProvider to be a public API
    also move NameResolver to be public.
---
 .../trinidadinternal/image/ImageConstants.java     |  2 +-
 .../image/cache/CompositeButtonKey.java            |  2 +-
 .../image/cache/FileSystemImageCache.java          |  3 +-
 .../image/cache/SourceCheckingCacheEntry.java      |  3 +-
 .../image/laf/browser/SourceUtils.java             |  3 +-
 .../share/io/CachingInputStreamProvider.java       |  3 +
 .../share/io/CachingNameResolver.java              |  4 ++
 .../share/io/DefaultNameResolver.java              |  4 ++
 .../share/io/FileInputStreamProvider.java          |  2 +
 .../share/io/InputStreamProvider.java              | 81 ----------------------
 .../share/io/InputStreamProviderProxy.java         |  1 +
 .../trinidadinternal/share/io/NameResolver.java    | 61 ----------------
 .../share/io/URLInputStreamProvider.java           |  2 +
 .../trinidadinternal/share/xml/XMLUtils.java       |  4 +-
 .../skin/SkinStyleSheetParserUtils.java            |  5 +-
 .../myfaces/trinidadinternal/skin/SkinUtils.java   |  4 +-
 .../trinidadinternal/skin/StyleSheetEntry.java     |  5 +-
 .../skin/StyleSheetNameResolver.java               |  4 +-
 .../style/xml/StyleSheetDocumentUtils.java         |  3 +-
 .../style/xml/parse/StyleSheetDocumentParser.java  |  2 +-
 .../myfaces/trinidadinternal/ui/laf/base/Icon.java |  2 +-
 .../ui/laf/base/xhtml/AccentIconRequest.java       |  3 +-
 .../ui/laf/base/xhtml/AccentedLafIconProvider.java |  4 +-
 .../ui/laf/base/xhtml/CoreIconRequest.java         |  4 +-
 .../ui/laf/base/xhtml/FlippedIconRequest.java      |  4 +-
 .../laf/base/xhtml/IconArrayLafIconProvider.java   |  2 +-
 .../simple/desktop/IconInputStreamProvider.java    |  2 +-
 .../ui/laf/simple/desktop/SimpleButtonUtils.java   |  2 +-
 28 files changed, 47 insertions(+), 174 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/ImageConstants.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/ImageConstants.java
index 20891b0..847b1cf 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/ImageConstants.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/ImageConstants.java
@@ -227,7 +227,7 @@ public interface ImageConstants
    * The InputStreamProvider is used to obtain image data for the
    * source images for global buttons and colorizeds.
    *
-   * @see org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider
+   * @see org.apache.myfaces.trinidad.share.io.InputStreamProvider
    */
   public static final Object SOURCE_INPUT_STREAM_PROVIDER_KEY = "inputStreamProvider";
 
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/CompositeButtonKey.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/CompositeButtonKey.java
index 3beaddc..6c60d47 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/CompositeButtonKey.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/CompositeButtonKey.java
@@ -24,7 +24,7 @@ import java.awt.Color;
 import java.util.Map;
 import org.apache.myfaces.trinidad.util.ArrayMap;
 
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 
 import org.apache.myfaces.trinidadinternal.image.ImageConstants;
 import org.apache.myfaces.trinidadinternal.image.ImageContext;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java
index f13c881..c183d29 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/FileSystemImageCache.java
@@ -44,7 +44,7 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 import org.apache.myfaces.trinidad.util.ArrayMap;
 
 import org.apache.myfaces.trinidadinternal.agent.TrinidadAgent;
@@ -62,7 +62,6 @@ import org.apache.myfaces.trinidadinternal.image.util.FileUtils;
 import org.apache.myfaces.trinidadinternal.image.util.MapArea;
 import org.apache.myfaces.trinidadinternal.image.xml.ImageProviderRequestUtils;
 import org.apache.myfaces.trinidadinternal.share.config.Configuration;
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
 import org.apache.myfaces.trinidadinternal.share.xml.XMLProvider;
 import org.apache.myfaces.trinidadinternal.share.xml.XMLUtils;
 import org.apache.myfaces.trinidadinternal.style.util.GraphicsUtils;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/SourceCheckingCacheEntry.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/SourceCheckingCacheEntry.java
index a14d7d2..1d8a8b6 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/SourceCheckingCacheEntry.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/SourceCheckingCacheEntry.java
@@ -25,12 +25,13 @@ import java.util.Map;
 
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 
 import org.apache.myfaces.trinidadinternal.image.ImageConstants;
 import org.apache.myfaces.trinidadinternal.image.ImageContext;
 import org.apache.myfaces.trinidadinternal.image.ImageProviderRequest;
 
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
+
 
 /**
  * Cache entry data structure which checks to see if the source
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/laf/browser/SourceUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/laf/browser/SourceUtils.java
index 6497895..25918fe 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/laf/browser/SourceUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/laf/browser/SourceUtils.java
@@ -26,8 +26,7 @@ import java.util.Map;
 
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 
 import org.apache.myfaces.trinidadinternal.image.ImageConstants;
 import org.apache.myfaces.trinidadinternal.image.ImageContext;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/CachingInputStreamProvider.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/CachingInputStreamProvider.java
index 4918a60..16224f4 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/CachingInputStreamProvider.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/CachingInputStreamProvider.java
@@ -20,6 +20,9 @@ package org.apache.myfaces.trinidadinternal.share.io;
 
 import java.util.Iterator;
 
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+
+
 /**
  * A subinterface of InputStreamProvider that adds support
  * for tracking dependencies.
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/CachingNameResolver.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/CachingNameResolver.java
index ffb25c2..ad70e2d 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/CachingNameResolver.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/CachingNameResolver.java
@@ -24,6 +24,10 @@ import java.util.Map;
 import java.util.Hashtable;
 import java.util.Iterator;
 
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
+
+
 /**
  * NameResolver that adds caching support.  Providers
  * that receive cached results (via setCachedResult) will
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/DefaultNameResolver.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/DefaultNameResolver.java
index 5803fad..95c1334 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/DefaultNameResolver.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/DefaultNameResolver.java
@@ -25,6 +25,10 @@ import java.io.IOException;
 import java.net.URL;
 import java.net.MalformedURLException;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
+
+
 
 /**
  * Default implementation of NameResolver.  This class
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/FileInputStreamProvider.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/FileInputStreamProvider.java
index 97b4cfa..cf93d5d 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/FileInputStreamProvider.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/FileInputStreamProvider.java
@@ -24,6 +24,8 @@ import java.io.FileInputStream;
 import java.io.InputStream;
 import java.io.IOException;
 
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+
 
 /**
  * An InputStreamProvider for loading files.
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/InputStreamProvider.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/InputStreamProvider.java
deleted file mode 100644
index 6f1b026..0000000
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/InputStreamProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *  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.trinidadinternal.share.io;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * InputStreamProviders encapsulate a single target file.
- * (There's no real requirement that there be a physical file
- * at the target location).
- * <p>
- * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/io/InputStreamProvider.java#0 $) $Date: 10-nov-2005.19:00:08 $
- */
-public interface InputStreamProvider
-{
-  /**
-   * Return an InputStream for the target.  This function
-   * should never return null - if a stream cannot be opened,
-   * throw an IOException.
-   */
-  public InputStream       openInputStream() throws IOException;
-
-  /**
-   * Returns the name of the target location, suitable
-   * for user display.
-   */
-  public String            getDisplayName();
-
-  /**
-   * Returns an identifier object that uniquely
-   * identifies the target location. If two providers
-   * return equal identifiers, that is, given:
-   * <pre>
-   *   Object identifierA = providerA.getIdentifier();
-   *   Object identifierB = providerB.getIdentifier();
-   * </pre>
-   * ... then:
-   * <pre>
-   *   if (identifierA.equals(identifierB)) ...
-   * </pre>
-   * then the two providers must point to the same location.
-   */
-  public Object            getIdentifier();
-
-  /**
-   * Returns true if the underlying target has changed
-   * since the last call to openInputStream()
-   */
-  public boolean           hasSourceChanged();
-
-  /**
-   * Returns the cached result from reading and parsing this
-   * provider.
-   * @see CachingNameResolver
-   */
-  public Object            getCachedResult();
-
-  /**
-   * Stores the cached result of reading and parsing this
-   * provider.
-   * @see CachingNameResolver
-   */
-  public void              setCachedResult(Object value);
-}
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/InputStreamProviderProxy.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/InputStreamProviderProxy.java
index e8aa466..68a184c 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/InputStreamProviderProxy.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/InputStreamProviderProxy.java
@@ -20,6 +20,7 @@ package org.apache.myfaces.trinidadinternal.share.io;
 
 import java.io.InputStream;
 import java.io.IOException;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 
 /**
  * Proxying class for InputStreamProviders.  Subclassers
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/NameResolver.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/NameResolver.java
deleted file mode 100644
index d29193b..0000000
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/NameResolver.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *  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.trinidadinternal.share.io;
-
-import java.io.IOException;
-
-/**
- * NameResolvers are responsible for converting string names
- * into InputStreamProviders, which encapsulate a remote file.
- * Implementations exist that support using URLs, Files, Class
- * resources, and the Servlet API to locate files, but other APIs
- * may be substituted.
- * <p>
- * In some cases, the resolved target file may have need to
- * locate support files of its own.  Since those support files should
- * be looked for relative to the target file, NameResolver supports
- * creating new relative NameResolvers.
- * <p>
- * Developers writing their own NameResolver should strongly
- * consider subclassing BaseNameResolver.
- * <p>
- * @see org.apache.myfaces.trinidadinternal.share.xml.XMLUtils#getResolver
- * @see org.apache.myfaces.trinidadinternal.share.xml.XMLUtils#setResolver
- * <p>
- * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/io/NameResolver.java#0 $) $Date: 10-nov-2005.19:00:09 $
- */
-public interface NameResolver
-{
-  /**
-   * Given a name, returns an InputStreamProvider.  This
-   * function should never return null - if the target
-   * cannot be resolved, throw an IOException.
-   * @param name the name of the target
-   */
-  public InputStreamProvider getProvider(String name) throws IOException;
-
-  /**
-   * Return the new NameResolver that should be used to resolve
-   * names relative to a given name.  This function should never
-   * return null - if the target cannot be resolved, return a
-   * resolver that can only support absolute names.
-   * @param name the name of the target
-   */
-  public NameResolver        getResolver(String name);
-}
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/URLInputStreamProvider.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/URLInputStreamProvider.java
index 8090336..f64756a 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/URLInputStreamProvider.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/io/URLInputStreamProvider.java
@@ -25,8 +25,10 @@ import java.io.IOException;
 import java.net.URL;
 import java.net.URLConnection;
 
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 import org.apache.myfaces.trinidad.util.URLUtils;
 
+
 /**
  * An InputStreamProvider for opening URLs.
  * <p>
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
index e2a29af..f711adb 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
@@ -32,14 +32,14 @@ import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.share.config.Configuration;
 import org.apache.myfaces.trinidadinternal.share.config.ConfigurationImpl;
 
 import org.apache.myfaces.trinidadinternal.share.io.CachingInputStreamProvider;
 import org.apache.myfaces.trinidadinternal.share.io.DefaultNameResolver;
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.share.expl.JavaMethod;
 
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
index 9751e15..d878dbb 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
@@ -34,12 +34,13 @@ import java.util.TreeSet;
 import java.util.regex.Pattern;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
+
 import org.apache.myfaces.trinidad.skin.Icon;
 import org.apache.myfaces.trinidad.util.URLUtils;
 import org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.SkinProperties;
 import org.apache.myfaces.trinidadinternal.share.expl.Coercions;
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.share.xml.ParseContext;
 import org.apache.myfaces.trinidadinternal.share.xml.XMLUtils;
 import org.apache.myfaces.trinidadinternal.skin.icon.ContextImageIcon;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java
index a7c2838..b47daa1 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinUtils.java
@@ -43,10 +43,11 @@ import javax.el.ValueExpression;
 import org.apache.myfaces.trinidad.skin.SkinFactory;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
-
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 import org.apache.myfaces.trinidad.skin.Icon;
 import org.apache.myfaces.trinidad.skin.Skin;
 import org.apache.myfaces.trinidad.skin.SkinAddition;
+
 import org.apache.myfaces.trinidadinternal.config.LazyValueExpression;
 import org.apache.myfaces.trinidadinternal.renderkit.core.skin.MinimalDesktopSkinExtension;
 import org.apache.myfaces.trinidadinternal.renderkit.core.skin.MinimalPdaSkinExtension;
@@ -58,7 +59,6 @@ import org.apache.myfaces.trinidadinternal.renderkit.core.skin.SimplePortletSkin
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.share.xml.ClassParserFactory;
 import org.apache.myfaces.trinidadinternal.share.xml.ParseContextImpl;
 import org.apache.myfaces.trinidadinternal.share.xml.ParserFactory;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
index b2bb2e6..e119d2a 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
@@ -20,12 +20,11 @@ package org.apache.myfaces.trinidadinternal.skin;
 
 import java.io.IOException;
 
-import java.util.List;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.share.io.CachingNameResolver;
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.share.xml.JaxpXMLProvider;
 import org.apache.myfaces.trinidadinternal.share.xml.ParseContextImpl;
 import org.apache.myfaces.trinidadinternal.share.xml.XMLProvider;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java
index 6f67e0f..853dd44 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java
@@ -30,11 +30,11 @@ import javax.faces.context.FacesContext;
 import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.share.io.DefaultNameResolver;
 import org.apache.myfaces.trinidadinternal.share.io.FileInputStreamProvider;
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.share.io.URLInputStreamProvider;
 
 import org.apache.myfaces.trinidadinternal.style.StyleContext;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
index c59f6ec..7246097 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
@@ -28,9 +28,8 @@ import java.util.List;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
-
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.share.io.DefaultNameResolver;
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.share.xml.ClassParserFactory;
 import org.apache.myfaces.trinidadinternal.share.xml.ParseContextImpl;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocumentParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocumentParser.java
index f505f1e..58e9bbf 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocumentParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocumentParser.java
@@ -36,8 +36,8 @@ import org.xml.sax.SAXParseException;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.util.URLUtils;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
 import org.apache.myfaces.trinidadinternal.share.xml.BaseNodeParser;
 import org.apache.myfaces.trinidadinternal.share.xml.NodeParser;
 import org.apache.myfaces.trinidadinternal.share.xml.ParseContext;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/Icon.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/Icon.java
index 640caca..d688540 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/Icon.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/Icon.java
@@ -18,7 +18,7 @@
  */
 package org.apache.myfaces.trinidadinternal.ui.laf.base;
 
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.style.CoreStyle;
 import org.apache.myfaces.trinidadinternal.ui.laf.LookAndFeel;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/AccentIconRequest.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/AccentIconRequest.java
index 873d5a2..196895c 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/AccentIconRequest.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/AccentIconRequest.java
@@ -22,12 +22,13 @@ import java.awt.Color;
 
 import java.util.Map;
 
+import org.apache.myfaces.trinidad.share.io.NameResolver;
+
 import org.apache.myfaces.trinidadinternal.image.ImageConstants;
 import org.apache.myfaces.trinidadinternal.image.ImageContext;
 
 import org.apache.myfaces.trinidadinternal.image.cache.AccentColorizedIconKey;
 
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.ui.laf.LookAndFeel;
 
 /**
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/AccentedLafIconProvider.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/AccentedLafIconProvider.java
index f533439..9002432 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/AccentedLafIconProvider.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/AccentedLafIconProvider.java
@@ -25,6 +25,8 @@ import java.awt.Color;
 import org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
+
 
 import org.apache.myfaces.trinidadinternal.image.ImageConstants;
 import org.apache.myfaces.trinidadinternal.image.ImageContext;
@@ -40,8 +42,6 @@ import org.apache.myfaces.trinidadinternal.ui.laf.base.ColorizedLafIconProvider;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.IconKey;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.Icon;
 
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
-
 /**
  * Abstracts out the retrieval of ImageProviderResponses for
  * dual ramp colorization.
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/CoreIconRequest.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/CoreIconRequest.java
index c4e4d2b..84c7a28 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/CoreIconRequest.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/CoreIconRequest.java
@@ -25,14 +25,14 @@ import java.io.IOException;
 import java.util.Map;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.image.ImageConstants;
 import org.apache.myfaces.trinidadinternal.image.ImageContext;
 
 import org.apache.myfaces.trinidadinternal.image.cache.CoreColorizedIconKey;
 
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.ui.laf.LookAndFeel;
 
 
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/FlippedIconRequest.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/FlippedIconRequest.java
index 567b9bd..ea72d4a 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/FlippedIconRequest.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/FlippedIconRequest.java
@@ -29,14 +29,14 @@ import javax.servlet.ServletContext;
 import javax.servlet.ServletRequest;
 
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.image.ImageConstants;
 import org.apache.myfaces.trinidadinternal.image.ImageContext;
 import org.apache.myfaces.trinidadinternal.image.cache.FlippedIconKey;
 
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
 import org.apache.myfaces.trinidadinternal.share.io.ServletNameResolver;
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 
 import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext;
 
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/IconArrayLafIconProvider.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/IconArrayLafIconProvider.java
index 1ee5ce0..99a686e 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/IconArrayLafIconProvider.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/base/xhtml/IconArrayLafIconProvider.java
@@ -20,6 +20,7 @@ package org.apache.myfaces.trinidadinternal.ui.laf.base.xhtml;
 
 import java.awt.Color;
 
+import org.apache.myfaces.trinidad.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.ui.laf.LookAndFeel;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.Icon;
 import org.apache.myfaces.trinidadinternal.ui.laf.base.IconKey;
@@ -27,7 +28,6 @@ import org.apache.myfaces.trinidadinternal.ui.laf.base.IconKey;
 import org.apache.myfaces.trinidadinternal.image.ImageContext;
 import org.apache.myfaces.trinidadinternal.image.ImageProviderRequest;
 
-import org.apache.myfaces.trinidadinternal.share.io.NameResolver;
 import org.apache.myfaces.trinidadinternal.ui.UIXRenderingContext;
 
 /**
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/IconInputStreamProvider.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/IconInputStreamProvider.java
index 567216b..eac421d 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/IconInputStreamProvider.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/IconInputStreamProvider.java
@@ -24,7 +24,7 @@ import java.io.IOException;
 import javax.faces.context.FacesContext;
 
 import org.apache.myfaces.trinidad.context.RenderingContext;
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 import org.apache.myfaces.trinidad.skin.Icon;
 
 /**
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/SimpleButtonUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/SimpleButtonUtils.java
index 3f6a7fb..c243b4d 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/SimpleButtonUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/ui/laf/simple/desktop/SimpleButtonUtils.java
@@ -24,7 +24,7 @@ import javax.faces.context.FacesContext;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
 import org.apache.myfaces.trinidad.context.RenderingContext;
-import org.apache.myfaces.trinidadinternal.share.io.InputStreamProvider;
+import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 
 import org.apache.myfaces.trinidad.context.LocaleContext;
 import org.apache.myfaces.trinidadinternal.style.util.FontProxy;

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 32/36: TRINIDAD-1729 provide a hook for for an external decorator of Skin InputStreamProvider NameResolver - changed the doc a little bit StyleSheetEntry - figure out which InputStreamProvider to use (FileInputStreamProvider, URLInputStreamProvider, etc) based on the filename, then create the StyleSheetNameResolver. If an InputStreamProvider cannot be created with these methods, then we look at META-INF/services/org.apache.myfaces.trinidad.share.io.NameResolver for a custom NameResolver. StyleShe [...]

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 889825afb97f835f259cd62dff71563d587474e4
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Wed Mar 10 17:38:27 2010 +0000

    TRINIDAD-1729 provide a hook for for an external decorator of Skin InputStreamProvider
    NameResolver - changed the doc a little bit
    StyleSheetEntry - figure out which InputStreamProvider to use (FileInputStreamProvider, URLInputStreamProvider, etc) based on the filename, then create the StyleSheetNameResolver. If an InputStreamProvider cannot be created with these methods, then we look at META-INF/services/org.apache.myfaces.trinidad.share.io.NameResolver for a custom NameResolver.
    StyleSheetNameResolver - changed to take the InputStreamProvider object created in StyleSheetEntry rather than creating the ISP in this class.
---
 .../myfaces/trinidad/share/io/NameResolver.java    |   3 +-
 .../trinidadinternal/skin/StyleSheetEntry.java     | 334 ++++++++++++++++++++-
 .../skin/StyleSheetNameResolver.java               | 240 +++------------
 3 files changed, 371 insertions(+), 206 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/NameResolver.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/NameResolver.java
index fcd3094..e9f3ebe 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/NameResolver.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/share/io/NameResolver.java
@@ -47,7 +47,8 @@ public interface NameResolver
 
   /**
    * Return the new NameResolver that should be used to resolve
-   * names relative to a given name.  This function should never
+   * names relative to a given name. For example, if a css file has an @import,
+   * you need to look for the imported file relative to the file. This function should never
    * return null - if the target cannot be resolved, return a
    * resolver that can only support absolute names.
    * @param name the name of the target
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
index e119d2a..de05856 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
@@ -18,13 +18,26 @@
  */
 package org.apache.myfaces.trinidadinternal.skin;
 
+import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.share.io.InputStreamProvider;
 import org.apache.myfaces.trinidad.share.io.NameResolver;
 
+import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
 import org.apache.myfaces.trinidadinternal.share.io.CachingNameResolver;
+import org.apache.myfaces.trinidadinternal.share.io.FileInputStreamProvider;
+import org.apache.myfaces.trinidadinternal.share.io.URLInputStreamProvider;
 import org.apache.myfaces.trinidadinternal.share.xml.JaxpXMLProvider;
 import org.apache.myfaces.trinidadinternal.share.xml.ParseContextImpl;
 import org.apache.myfaces.trinidadinternal.share.xml.XMLProvider;
@@ -62,7 +75,7 @@ class StyleSheetEntry
     // In order to create the StyleSheetEntry, we need to locate and
     // parse the style sheet file.  We use a NameResolver to use to
     // find the style sheet.
-    NameResolver resolver = _getNameResolver(context);
+    NameResolver resolver = _getNameResolver(context, styleSheetName);
     if (resolver == null)
       return null;
 
@@ -144,6 +157,68 @@ class StyleSheetEntry
   {
     return false;
   }
+  
+  // Gets a File for the specified name, or returns null if no file exists
+  // Try the local styles directory.
+  public static File resolveLocalFile(File localStylesDir, String name)
+  {
+    // Try the local styles directory
+    File file = new File(localStylesDir, name);
+    if (file.exists())
+      return file;
+
+    return null;
+  }
+
+  // Gets an URL for the specified name using ClassLoaderUtils.getResource
+  public static URL resolveClassLoaderURL(String name)
+  {
+    if (name == null)
+      return null;
+    return ClassLoaderUtils.getResource(name);
+
+  }
+
+  // Gets an URL for the non static urls -- that is, urls that could change after the
+  // server has started.
+  public static URL resolveNonStaticURL(String name)
+  {
+    if (name == null)
+      return null;
+    FacesContext fContext = FacesContext.getCurrentInstance();
+    if (fContext != null)
+    {
+      try
+      {
+        if (name.startsWith("http:") ||
+            name.startsWith("https:") ||
+            name.startsWith("file:") ||
+            name.startsWith("ftp:") ||
+            name.startsWith("jar:"))
+        {
+          URL url = new URL(name);
+          if (url != null)
+            return url;
+        }
+        else
+        {
+          String rootName = _getRootName(name);
+          // Return a URL for the application resource mapped to the specified path,
+          // if it exists; otherwise, return null.
+          URL url = fContext.getExternalContext().getResource(rootName);
+          if (url != null)
+            return url;
+        }
+      }
+      catch (MalformedURLException e)
+      {
+        // Eat the MalformedURLException - maybe the name isn't an URL
+        ;
+      }
+    }
+    return null;
+  }  
+  
 
   // Called by CheckModifiedEntry when the style sheet has changed
   void __setDocument(StyleSheetDocument document)
@@ -248,14 +323,36 @@ class StyleSheetEntry
 
 
 
-  // Returns the NameResolver to use for locating style sheet files
+  // Returns the NameResolver to use for locating and loading style sheet file.
+  // Depending upon what the styleSheetName is, we load the file different way: local file,
+  // url, etc.
   private static NameResolver _getNameResolver(
-    StyleContext context
+    StyleContext context,
+    String       styleSheetName
     )
   {
-    // First, get a NameResolver that we can use to resolve
-    // locate the style sheet file.
-    NameResolver resolver = StyleSheetNameResolver.createResolver(context);
+    // get localStylesDirectory
+    File localStylesDir = _getStylesDir(context);
+
+    // Make sure we have some styles directory
+    if ((localStylesDir == null))
+    {
+      _LOG.warning(_STYLES_DIR_ERROR);
+      return null;
+    }
+    NameResolver resolver = null;
+
+    try
+    {
+      resolver =
+          _getNameResolverForStyleSheetFile(context, localStylesDir, styleSheetName);
+    }
+    catch (IOException e)
+    {
+      if (_LOG.isSevere())
+        _LOG.severe("CANNOT_LOAD_STYLESHEET", styleSheetName);
+        _LOG.severe(e);
+    }
     if (resolver == null)
     {
       // If we can't get a NameResolver, something is seriously wrong.
@@ -267,6 +364,80 @@ class StyleSheetEntry
     // can use to check for updates to imported style sheets
     return new CachingNameResolver(resolver, null, true);
   }
+  
+  /**
+   * <p>
+   * This method tries to find the Skin's stylesheet file (e.g., purple-desktop.css). 
+   * It creates a NameResolver object, and it returns the NameResolver object. 
+   * A NameResolver object contains an
+   * InputStreamProvider (this object loads the file) and a sub- NameResolver 
+   * that finds files that are relative to the base file, like an @import file in a .css file.
+   * </p>
+   * <p>
+   * This method tries to find the stylesheet file, first locally, or using an url, or a static url, 
+   * then we create a StyleSheetNameResolver and we pass in the InputStreamProvider we created that
+   * we know can find the file. If we can't find the file any of these ways, then we check 
+   * META-INF/services for a NameResolver service. This is how a third party can customize
+   * how they can find files, by supplying a META-INF/services NameResolver implementation. 
+   * </p>
+   * @param context
+   * @param localStylesDir File the local styles directory
+   * @param filename the stylesheet name
+   * @return NameResolver - either a StyleSheetNameResolver or the META-INF/services NameResolver
+   * implementation. The META-INF/services NameResolver implementation is the way a third party
+   * can customize the way they find and load files.
+   * @throws IOException when the file could not be found in all of the ways we tried to find it.
+   */
+  private static NameResolver _getNameResolverForStyleSheetFile(
+    StyleContext context, 
+    File         localStylesDir,
+    String       filename) throws IOException
+  {
+    InputStreamProvider provider = null;
+    
+    File file = StyleSheetEntry.resolveLocalFile(localStylesDir, filename);
+    if (file != null)
+      provider = new FileInputStreamProvider(file);
+    
+    if (provider == null)
+    {
+      // Gets an URL for the specified name.
+      // Try a few different means to get the file as an url and then create the appropriate
+      // InputStreamProvider from that URL.
+      URL url = resolveNonStaticURL(filename);
+      if (url != null)
+        provider = new URLInputStreamProvider(url);
+      else
+      {
+        // see if it is an URL that can be loaded by the ClassLoader.
+        // We create a StaticURLInputStreamProvider from the url because we consider the
+        // url static because it can't be changed without restarting the server, so we don't
+        // need to check if the source has changed.
+        url = resolveClassLoaderURL(filename);
+        if (url != null)
+          provider = new StaticURLInputStreamProvider(url);
+      }
+    }
+    // If at this point we have found an InputStreamProvider, then we will create a 
+    // StyleSheetNameResolver. Otherwise, we need to check for a custom NameResolver.
+    if (provider != null)
+      return StyleSheetNameResolver.createResolver(context, localStylesDir, provider);
+
+    // If we still can't locate the file at this point, then look for a custom
+    // NameResolver specified as a META-INF\services.
+    NameResolver servicesNameResolver = _loadNameResolverFromServices(filename);
+    if (servicesNameResolver != null)
+    {
+      if (_LOG.isFine())
+      {
+        _LOG.fine("Using the InputStreamProvider from META-INF\\services");
+      }
+      return servicesNameResolver;
+    }
+
+    // If we couldn't locate the file, throw an IOException
+    throw new FileNotFoundException(_getFileNotFoundMessage(localStylesDir, filename));
+  }
 
 
   // Subclass of StyleSheetEntry which recreates the StyleSheetEntry
@@ -301,10 +472,11 @@ class StyleSheetEntry
         __setDocument(null);
 
         // Get a new NameResolver
-        NameResolver resolver = _getNameResolver(context);
+        String name = getStyleSheetName();
+        NameResolver resolver = _getNameResolver(context, name);
         if (resolver != null)
         {
-          String name = getStyleSheetName();
+          
 
           // Recreate the StyleSheetEntry for the styleSheet using the new NameResolver
           // (e.g., if purpleSkin.css
@@ -358,11 +530,153 @@ class StyleSheetEntry
 
     private InputStreamProvider _provider;
   }
+  
 
-  private String              _name;
-  private StyleSheetDocument  _document;
 
+  // Construct error message for the specified file name
+  private static String _getFileNotFoundMessage(File localStylesDir, String name)
+  {
+    StringBuffer buffer = new StringBuffer();
+    buffer.append("Unable to locate style sheet \"");
+    buffer.append(name);
+    buffer.append("\" in ");
+
+    if (localStylesDir != null)
+    {
+      buffer.append("local styles directory (");
+      buffer.append(localStylesDir.getPath());
+      buffer.append("), ");
+    }
+
+    buffer.append("or on the class path.\n");
+    buffer.append("Please be sure that this style sheet is installed.");
+
+    return buffer.toString();
+  }
+
+  // Returns the File corresponding to the styles directory - either
+  // the local directory or the shared directory - depending on the
+  // shared value
+  private static File _getStylesDir(
+    StyleContext context)
+  {
+    String contextPath = context.getGeneratedFilesPath();
+
+    // We only need to look up the shared styles path if the shared
+    // context path is non-null.  If the shared context path is null,
+    // we don't have a shared styles directory (and calling
+    // Configuration.getPath() may throw a DirectoryUnavailableException).
+    if (contextPath == null)
+      return null;
+
+    String stylesPath = contextPath + "/adf/styles";
+
+    // Convert the path to a File
+    File stylesDir = new File(stylesPath);
+
+    // Make sure the directory actually exists
+    if (stylesDir.exists())
+       return stylesDir;
+
+    return null;
+  }
+
+  // Returns a name which can be resolved relative to the
+  // ServletContext root.
+  private static String _getRootName(String name)
+  {
+    // Tack on a starting "/" if the name doesn't already have one -
+    // seems to be required by ServletContext.getRealPath() and
+    // ServletContext.getResource() - at least on OC4J.
+    return (name.startsWith("/")) ? name : ("/" + name);
+  }
+
+  /**
+   * Returns an instance of NameResolver that was set in META-INF\services.
+   * This is used only if the stylesheet cannot be found any other way.
+   * This way third party users can create their own way to find the file e.g., MDS.
+   *
+   * @return a NameResolver instance that has been defined in META-INF\services\
+   * org.apache.myfaces.trinidad.share.io.NameResolver
+  // In this file they will have a line like "org.mycompany.io.MyNameResolverImpl".
+   * null if no NameResolver is found.
+   */
+  static private NameResolver _loadNameResolverFromServices(String name)
+  {
+    // We don't want to check services every time, so instead store it on the applicationMap.
+    FacesContext context = FacesContext.getCurrentInstance();
+    Map<String, Object> appMap = context.getExternalContext().getApplicationMap();
+
+    // Is it stored on the application map already? If so, use it.
+    NameResolver savedResolver = (NameResolver)appMap.get(_SERVICES_RESOLVER_KEY);
+    if (savedResolver != null)
+      return savedResolver;
+
+    List<NameResolver> resolvers = ClassLoaderUtils.getServices(
+                                      _NAME_RESOLVER_CLASS_NAME);
+
+    for (NameResolver customNameResolver : resolvers)
+    {
+      InputStreamProvider provider = null;
+      try
+      {
+        provider = customNameResolver.getProvider(name);
+      }
+      catch (IOException e)
+      {
+        // Log fine message. Try the next factory to get a provider
+        if (_LOG.isFine())
+          _LOG.fine(_SERVICES_RESOLVER_IOEXCEPTION_MSG);       
+      }
+      // Found a provider. So store it away and return it from the method.
+      if (provider != null)
+      {
+        appMap.put(_SERVICES_RESOLVER_KEY, provider);
+        return customNameResolver;
+      }
+    }
+    
+    return null;
+
+  }
+
+  // A subclass of URLInputStreamProvider which never checks for
+  // modifications
+  private static class StaticURLInputStreamProvider
+    extends URLInputStreamProvider
+  {
+    public StaticURLInputStreamProvider(URL url)
+    {
+      super(url);
+    }
+
+    @Override
+    public boolean hasSourceChanged()
+    {
+      return false;
+    }
+  }
+
+  // for META-INF\services\org.apache.myfaces.trinidad.share.io.NameResolver
+  // In this file they will have a line like "org.mycompany.io.MyNameResolverImpl"
+  static private final String _NAME_RESOLVER_CLASS_NAME =
+    NameResolver.class.getName();
+
+  // Error messages
+  private static final String _STYLES_DIR_ERROR =
+    "Could not locate the Trinidad styles directory."
+    + "Please be sure that the Trinidad installable resources are installed.";
+  
+  private static final String _SERVICES_RESOLVER_IOEXCEPTION_MSG =
+    "IOException when calling the META-INF/services NameResolver's getProvider method. " +
+    "Trying next nameResolver.";
+
+  private static final String _SERVICES_RESOLVER_KEY =
+    "org.apache.myfaces.trinidadinternal.skin.SERVICES_RESOLVER_KEY";  
 
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(StyleSheetEntry.class);
+  
+  private String              _name;
+  private StyleSheetDocument  _document;
 
 }
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java
index 853dd44..e83a5c5 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetNameResolver.java
@@ -42,29 +42,30 @@ import org.apache.myfaces.trinidadinternal.style.StyleContext;
 
 /**
  * Package-private utility class used by StyleSheetEntry to
- * locate style sheet source files.  We look for style sheets
- * in both the local and the shared "styles" directory.
+ * locate style sheet source files. The NameResolver in the StyleSheetNameResolver looks for
+ * the imported stylesheets relative to the base stylesheet.
  *
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/skin/StyleSheetNameResolver.java#0 $) $Date: 10-nov-2005.18:59:02 $
  */
 class StyleSheetNameResolver implements NameResolver
 {
   /**
-   * Creates a NameResolver which can locate style sheets
-   * for the specified StyleContext
+   * Creates a NameResolver which can locate style sheets in the local styles directory. 
+   * This method is called from StyleSheetEntry which loads and parses stylesheets (xss or css).
+   * The localStylesDir has already been checked to be valid before this method is called.
+   * @param context StyleContext
+   * @param localStylesDir File
+   * @param provider InputStreamProvider. This object was created in StyleSheetEntry based on
+   * the best way to load the particular stylesheet file. 
+   * It can be an FileInputStreamProvider, an URLInputStreamProvider, etc.
+   * @return
    */
-  public static NameResolver createResolver(StyleContext context)
-  {
-    File localStylesDir = _getStylesDir(context);
-
-    // Make sure we have some styles directory
-    if ((localStylesDir == null))
-    {
-      _LOG.warning(_STYLES_DIR_ERROR);
-      return null;
-    }
-
-    return new StyleSheetNameResolver(localStylesDir);
+  public static NameResolver createResolver(
+    StyleContext        context, 
+    File                localStylesDir,
+    InputStreamProvider provider)
+  {   
+    return new StyleSheetNameResolver(localStylesDir, provider);
   }
 
   /**
@@ -72,219 +73,68 @@ class StyleSheetNameResolver implements NameResolver
    * styles directories.  Note that the constructor is private since
    * StyleSheetEntry always calls createResolver().
    * @param localStylesDirectory The location of the local styles directory
+   * @param provider The InputStreamProvider. e.g., FileInputStreamProvider, URLInputStreamProvider,
+   * etc.
    */
   private StyleSheetNameResolver(
-    File localStylesDirectory
+    File                localStylesDirectory,
+    InputStreamProvider provider
     )
   {
     // We should always have some directory
     assert ((localStylesDirectory != null));
+    
+    // We should always have some provider
+    assert ((provider != null));
+
 
     _localStylesDir = localStylesDirectory;
+    _provider = provider;
 
   }
 
   /**
-   * Implementation of NameResolver.getProvider().
-   * Given the name of the file, create an InputStreamProvider. I
+   * Returns the InputStreamProvider for this StyleSheetNameResolver.
+   * @param name the stylesheet name.
+   * @return the InputStreamProvider. The InputStreamProvider knows how to return an InputStream
+   * of the file, it knows if the source has changed, etc.
+   * @throws IOException
+   * @see InputStreamProvider
    */
   public InputStreamProvider getProvider(String name) throws IOException
   {
-    File file = _resolveLocalFile(name);
-    if (file != null)
-      return new FileInputStreamProvider(file);
-      
-    // Gets an URL for the specified name. 
-    // Try a few different means to get the file as an url and then create the appropriate
-    // InputStreamProvider from that URL.
-    URL url = _resolveNonStaticURL(name);
-    if (url != null)
-      return new URLInputStreamProvider(url);
-    else
-    {
-      // see if it is an URL that can be loaded by the ClassLoader. 
-      // We create a StaticURLInputStreamProvider from the url because we consider the
-      // url static because it can't be changed without restarting the server, so we don't
-      // need to check if the source has changed.
-      url = _resolveClassLoaderURL(name);
-      if (url != null)
-        return new StaticURLInputStreamProvider(url);
-    }
-      
-
-
-    // If we couldn't locate the file, throw an IOException
-    throw new FileNotFoundException(_getFileNotFoundMessage(name));
+    return _provider;
   }
 
   /**
-   * Implementation of NameResolver.getResolver()
+   * Implementation of NameResolver.getResolver(). This gets the file that is relative to
+   * the base file.
+   * @param name  String name of the file that is the imported stylesheet.
+   * @return NameResolver. A resolver that knows how to resolve files relative to a base file.
+   * e.g., DefaultNameResolver
    */
   public NameResolver getResolver(String name)
   {
     URL url = null;
-    File file = _resolveLocalFile(name);
+    File file = StyleSheetEntry.resolveLocalFile(_localStylesDir, name);
     if (file == null)
     {
       // Gets an URL for the specified name. 
       // Try a few different means to get the file as an url: 
       // new URL, ExternalContext's getResource, ClassLoaderUtils getResource
-      
-      url = _resolveNonStaticURL(name);
+
+      url = StyleSheetEntry.resolveNonStaticURL(name);
       if (url == null)
-        url =_resolveClassLoaderURL(name);
+        url =StyleSheetEntry.resolveClassLoaderURL(name);
     }
 
-    // Just use a DefaultNameResolver to resolve relative files
     return new DefaultNameResolver(file, url);
   }
 
-  // Gets a File for the specified name, or returns null if no file exists
-  // Try the local styles directory.
-  private File _resolveLocalFile(String name)
-  {
-    // Try the local styles directory
-    File file = new File(_localStylesDir, name);
-    if (file.exists())
-      return file;
-
-    return null;
-  }
-
-  // Gets an URL for the specified name using ClassLoaderUtils.getResource
-  private URL _resolveClassLoaderURL(String name)
-  {
-    if (name == null)
-      return null;
-    return ClassLoaderUtils.getResource(name);
-    
-  }
-  
-  // Gets an URL for the non static urls -- that is, urls that could change after the 
-  // server has started.
-  private URL _resolveNonStaticURL(String name)
-  {
-    if (name == null)
-      return null;
-    FacesContext fContext = FacesContext.getCurrentInstance();
-    if (fContext != null)
-    {
-      try
-      {
-        if (name.startsWith("http:") ||
-            name.startsWith("https:") ||
-            name.startsWith("file:") ||
-            name.startsWith("ftp:") ||
-            name.startsWith("jar:"))
-        {
-          URL url = new URL(name);
-          if (url != null)
-            return url;
-        }
-        else
-        {
-          String rootName = _getRootName(name);
-          // Return a URL for the application resource mapped to the specified path, 
-          // if it exists; otherwise, return null.
-          URL url = fContext.getExternalContext().getResource(rootName);
-          if (url != null)
-            return url;
-        }
-      }
-      catch (MalformedURLException e)
-      {
-        // Eat the MalformedURLException - maybe the name isn't an URL
-        ;
-      }
-    }
-    return null;
-  }
-
-  // Construct error message for the specified file name
-  private String _getFileNotFoundMessage(String name)
-  {
-    StringBuffer buffer = new StringBuffer();
-    buffer.append("Unable to locate style sheet \"");
-    buffer.append(name);
-    buffer.append("\" in ");
-
-    if (_localStylesDir != null)
-    {
-      buffer.append("local styles directory (");
-      buffer.append(_localStylesDir.getPath());
-      buffer.append("), ");
-    }
-
-    buffer.append("or on the class path.\n");
-    buffer.append("Please be sure that this style sheet is installed.");
-
-    return buffer.toString();
-  }
-
-  // Returns the File corresponding to the styles directory - either
-  // the local directory or the shared directory - depending on the
-  // shared value
-  private static File _getStylesDir(
-    StyleContext context)
-  {
-    String contextPath = context.getGeneratedFilesPath();
-
-    // We only need to look up the shared styles path if the shared
-    // context path is non-null.  If the shared context path is null,
-    // we don't have a shared styles directory (and calling
-    // Configuration.getPath() may throw a DirectoryUnavailableException).
-    if (contextPath == null)
-      return null;
-
-    String stylesPath = contextPath + "/adf/styles";
-
-    // Convert the path to a File
-    File stylesDir = new File(stylesPath);
-
-    // Make sure the directory actually exists
-    if (stylesDir.exists())
-       return stylesDir;
-
-    return null;
-  }
-
-  // Returns a name which can be resolved relative to the
-  // ServletContext root.
-  private static String _getRootName(String name)
-  {
-    // Tack on a starting "/" if the name doesn't already have one -
-    // seems to be required by ServletContext.getRealPath() and
-    // ServletContext.getResource() - at least on OC4J.
-    return (name.startsWith("/")) ? name : ("/" + name);
-  }
-
-
-
-  // A subclass of URLInputStreamProvider which never checks for
-  // modifications
-  private static class StaticURLInputStreamProvider
-    extends URLInputStreamProvider
-  {
-    public StaticURLInputStreamProvider(URL url)
-    {
-      super(url);
-    }
-
-    @Override
-    public boolean hasSourceChanged()
-    {
-      return false;
-    }
-  }
-
-
   private File _localStylesDir;
-
-  // Error messages
-  private static final String _STYLES_DIR_ERROR =
-    "Could not locate the Trinidad styles directory."
-    + "Please be sure that the Trinidad installable resources are installed.";
-
+  private InputStreamProvider _provider;
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(StyleSheetNameResolver.class);
+  private static final String _SERVICES_PROVIDER_KEY =
+    "org.apache.myfaces.trinidadinternal.skin.SERVICES_PROVIDER_KEY";
 }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 05/36: TRINIDAD-1687 add a Skin api that will clear the skin file(s) and reload at runtime The api is /** * Check to see if this Skin has been marked dirty. * The only way to mark a Skin dirty is to call setDirty(true). * @return true if the Skin is marked dirty. */ abstract public boolean isDirty();

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 585232b5aa1789d899d0684452778a16aa1c3771
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Mon Jan 18 22:56:52 2010 +0000

    TRINIDAD-1687 add a Skin api that will clear the skin file(s) and reload at runtime
    The api is
      /**
       * Check to see if this Skin has been marked dirty.
       * The only way to mark a Skin dirty is to call setDirty(true).
       * @return true if the Skin is marked dirty.
       */
      abstract public boolean isDirty();
    
      /**
       * Sets the dirty flag of the Skin. Use this if you want to regenerate the skin.
       * During rendering, if isDirty is true,
       * the skin's css file will be reprocessed regardless of whether the css file has been modified
       * or if the CHECK_FILE_MODIFICATION flag was set.
       * The Skinning Framework calls setDirty(false) after the skin has been reprocessed.
       */
      abstract public void setDirty(boolean dirty);
---
 .../org/apache/myfaces/trinidad/skin/Skin.java     | 16 ++++++++
 .../trinidaddemo/SkinDirtyPhaseListener.java       | 46 +++++++++++++++++++++
 .../src/main/webapp/WEB-INF/faces-config.xml       |  6 ++-
 .../src/main/webapp/demos/panelPageSkinDemo.jspx   |  2 +-
 .../renderkit/core/StyleContextImpl.java           |  7 ++++
 .../trinidadinternal/skin/RequestSkinWrapper.java  | 11 +++++
 .../trinidadinternal/skin/SkinExtension.java       | 15 +++++++
 .../myfaces/trinidadinternal/skin/SkinImpl.java    | 31 +++++++++++++-
 .../trinidadinternal/skin/StyleSheetEntry.java     | 13 +++---
 .../trinidadinternal/style/StyleContext.java       |  1 +
 .../style/cache/FileSystemStyleCache.java          | 48 +++++++++++++++++-----
 .../trinidadinternal/resource/LoggerBundle.xrts    |  1 +
 12 files changed, 176 insertions(+), 21 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java
index 2ec29e8..1392039 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/skin/Skin.java
@@ -186,5 +186,21 @@ abstract public class Skin
    * @return List a List of SkinAdditions.
    */
   abstract public List<SkinAddition> getSkinAdditions ();
+  
+  /**
+   * Check to see if this Skin has been marked dirty. 
+   * The only way to mark a Skin dirty is to call setDirty(true).
+   * @return true if the Skin is marked dirty. 
+   */
+  abstract public boolean isDirty();
+
+  /**
+   * Sets the dirty flag of the Skin. Use this if you want to regenerate the skin. 
+   * During rendering, if isDirty is true, 
+   * the skin's css file will be reprocessed regardless of whether the css file has been modified 
+   * or if the CHECK_FILE_MODIFICATION flag was set. 
+   * The Skinning Framework calls setDirty(false) after the skin has been reprocessed.
+   */
+  abstract public void setDirty(boolean dirty);
     
 }
diff --git a/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/SkinDirtyPhaseListener.java b/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/SkinDirtyPhaseListener.java
new file mode 100644
index 0000000..684da26
--- /dev/null
+++ b/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/SkinDirtyPhaseListener.java
@@ -0,0 +1,46 @@
+package org.apache.myfaces.trinidaddemo;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.apache.myfaces.trinidad.context.RenderingContext;
+import org.apache.myfaces.trinidad.context.RequestContext;
+
+/**
+ * This class is used in panelPageSkinDemo.jspx. It sets the Skin to dirty so that if you
+ * change a skin css file it gets picked up immediately without the need to set the web.xml
+ * CHECK_FILE_MODIFICATION flag.
+ */
+public class SkinDirtyPhaseListener
+  implements PhaseListener
+{
+  public SkinDirtyPhaseListener()
+  {
+    super();
+  }
+
+  public void afterPhase(PhaseEvent phaseEvent)
+  {
+  }
+
+  public void beforePhase(PhaseEvent phaseEvent)
+  {
+    // Add event code here...
+    System.out.println("***PhaseTracker: Before Phase: " + phaseEvent.getPhaseId());
+    RenderingContext rContext = RenderingContext.getCurrentInstance();
+    if (rContext != null)
+    {
+      System.out.println("Set Skin to dirty");
+      rContext.getSkin().setDirty(true);
+    }
+    else
+      System.out.println("rContext in _beforePhase is null!");
+
+  }
+
+  public PhaseId getPhaseId()
+  {
+    return PhaseId.ANY_PHASE;
+  }
+}
diff --git a/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml b/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml
index 0a91f2f..4c32694 100644
--- a/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml
+++ b/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/faces-config.xml
@@ -3065,5 +3065,9 @@
     <managed-bean-class>org.apache.myfaces.trinidaddemo.DemoAccessibilityProfileBean</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>
-
+  <managed-bean>
+    <managed-bean-name>skinDirty</managed-bean-name>
+    <managed-bean-class>org.apache.myfaces.trinidaddemo.SkinDirtyPhaseListener</managed-bean-class>
+    <managed-bean-scope>request</managed-bean-scope>
+  </managed-bean>
 </faces-config>
diff --git a/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx b/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
index 07b4ac2..ad6632b 100644
--- a/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
+++ b/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
@@ -24,7 +24,7 @@
           xmlns:trh="http://myfaces.apache.org/trinidad/html"
           xmlns:tr="http://myfaces.apache.org/trinidad">
   <jsp:directive.page contentType="text/html;charset=utf-8"/>
-  <f:view>
+  <f:view beforePhase="#{skinDirty.beforePhase}">
     <trh:html>
       <trh:head title="Skin Demo">
         <!-- the beach skin is defined in beach.css. If you want to add your own
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
index 7c7ebdd..9eb7305 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/StyleContextImpl.java
@@ -132,6 +132,13 @@ class StyleContextImpl implements StyleContext
       context.getExternalContext().getInitParameter(Configuration.CHECK_TIMESTAMP_PARAM);
     return "true".equals(checkTimestamp);
   }
+  /*
+   * checks to see if the Skin is dirty by calling skin.isDirty()
+   */
+  public boolean isDirty()
+  {
+    return _arc.getSkin().isDirty();
+  }
 
   public boolean disableStandardsMode()
   {
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java
index ba1cfef..6106c2d 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/RequestSkinWrapper.java
@@ -312,6 +312,17 @@ public class RequestSkinWrapper extends Skin implements DocumentProviderSkin
 
     return ((DocumentProviderSkin)_skin).getStyleSheetDocument(styleContext);
   }
+  
+  @Override
+  public boolean isDirty()
+  {
+    return _skin.isDirty();
+  }
+  @Override
+  public void setDirty(boolean dirty)
+  {
+    _skin.setDirty(dirty);
+  }
 
   // Returns request-specific map of icon names to Icons
   private Map<String, Icon> _getRequestIcons()
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
index 6f66009..3b0305c 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinExtension.java
@@ -548,6 +548,21 @@ public class SkinExtension extends SkinImpl
       return _fullStyleSheetDocument;
     }
   }
+  
+  /**
+   * Set the skin to be dirty. This will force the skin's css file to
+   * be reprocessed regardless of whether the css file has been modified 
+   * or if the CHECK_FILE_MODIFICATION flag was set.
+   * The Skinning Framework sets the dirty flag back to 
+   * false once it has reprocessed the skin.
+   */
+  @Override
+  public void setDirty(boolean dirty)
+  {
+    super.setDirty(dirty);
+    // also, set the base skin's dirty flag
+    getBaseSkin().setDirty(dirty);
+  }
 
   /**
    * Find the actual icon
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
index 929008b..5ecb82a 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinImpl.java
@@ -386,6 +386,31 @@ abstract public class SkinImpl extends Skin implements DocumentProviderSkin
     SkinAddition addition = new SkinAddition(styleSheetName);
     addSkinAddition(addition);
   }
+  
+  /**
+   * Check to see if this Skin has been marked dirty. 
+   * The only way to mark a Skin dirty is to call setDirty(true).
+   * @return true if the Skin is marked dirty. 
+   * 
+   */
+  @Override
+  public boolean isDirty()
+  {
+    return _dirty;
+  }
+
+  /**
+   * Sets the dirty flag of the Skin. Use this if you want to regenerate the skin. 
+   * During rendering, if isDirty is true, 
+   * the skin's css file will be reprocessed regardless of whether the css file has been modified 
+   * or if the CHECK_FILE_MODIFICATION flag was set. 
+   * The Skinning Framework calls setDirty(false) after the skin has been reprocessed.
+   */
+   @Override
+  public void setDirty(boolean dirty)
+  {
+    _dirty = dirty;
+  }
 
   /**
    * Returns a translated value in the LocaleContext's translation Locale, or null
@@ -489,10 +514,11 @@ abstract public class SkinImpl extends Skin implements DocumentProviderSkin
   abstract protected ValueExpression getTranslationSourceValueExpression();
 
   // Checks to see whether any of our style sheets have been updated
+  // or if the skin has been marked dirty
   private boolean _checkStylesModified(
     StyleContext context
     )
-  {
+  {    
     boolean modified = false;
 
     if (_skinStyleSheet != null)
@@ -1157,6 +1183,7 @@ abstract public class SkinImpl extends Skin implements DocumentProviderSkin
   // HashMap of Skin properties
   private ConcurrentHashMap<Object, Object> _properties= new ConcurrentHashMap<Object, Object>();
 
-
+  private boolean _dirty;
+  
   private static final TrinidadLogger _LOG = TrinidadLogger.createTrinidadLogger(SkinImpl.class);
 }
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
index acd0291..b2bb2e6 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
@@ -78,9 +78,10 @@ class StyleSheetEntry
         return null;
 
       // We either create a plain old StyleSheetEntry or a special
-      // subclass of StyleSheetEntry that can check for modifications
-      // depending on the Configuration settings
-      if (context.checkStylesModified())
+      // subclass of StyleSheetEntry that will recalculate the StyleSheetEntry
+      // if the skin is dirty or if there are file modifications
+      // and the Configuration settings say to check for file modifications.
+      if (context.checkStylesModified() || context.isDirty())
         return new CheckModifiedEntry(styleSheetName,
                                       skinStyleSheet.getDocument(),
                                       resolver);
@@ -269,8 +270,8 @@ class StyleSheetEntry
   }
 
 
-  // Subclass of StyleSheetEntry which checks for updates
-  // to the underlying style sheet files.
+  // Subclass of StyleSheetEntry which recreates the StyleSheetEntry
+  // if the skin is marked dirty (skin.isDirty()) or if the underlying source files have been modified.
   private static class CheckModifiedEntry extends StyleSheetEntry
   {
     public CheckModifiedEntry(
@@ -294,7 +295,7 @@ class StyleSheetEntry
     {
       // We would synchronize here, but at the moment synchronization
       // is provided by Skin.getStyleSheetDocument().
-      if ((_provider != null) && (_provider.hasSourceChanged()))
+      if (context.isDirty() || ((_provider != null) && (_provider.hasSourceChanged())))
       {
         // Throw away the old InputStreamProvider and StyleSheetDocument
         _provider = null;
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java
index dfb1679..8f5107a 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/StyleContext.java
@@ -53,4 +53,5 @@ public interface StyleContext
   public AccessibilityProfile getAccessibilityProfile();
   public boolean isPortletMode();
   public boolean isDisableStyleCompression();
+  public boolean isDirty();
 }
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
index b21f1e0..ef9bad1 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
@@ -290,7 +290,9 @@ public class FileSystemStyleCache implements StyleProvider
     StyleSheetDocument document = null;
     Map<String, String> shortStyleClassMap = null;
     String[] namespacePrefixes = null;
-
+    RenderingContext arc = RenderingContext.getCurrentInstance();
+    Skin skin = arc.getSkin();
+    boolean isDirty = skin.isDirty();
     boolean checkModified  = context.checkStylesModified();
 
     // Synchronize while set up the _cache, _entryCache, _document, etc...
@@ -298,7 +300,7 @@ public class FileSystemStyleCache implements StyleProvider
     {
       // If checking for modified files, then check to see if the XSS or CSS
       // document has been modified.  If so, we dump our in-memory style cache.
-      if (checkModified && hasSourceDocumentChanged(context))
+      if (isDirty || (checkModified && hasSourceDocumentChanged(context)))
       {
         _cache = null;
         _entryCache = null;
@@ -356,7 +358,8 @@ public class FileSystemStyleCache implements StyleProvider
                         entryCache,
                         shortStyleClassMap,
                         namespacePrefixes,
-                        checkModified);
+                        checkModified, 
+                        isDirty);
   }
 
   private Entry _getEntry(
@@ -422,7 +425,8 @@ public class FileSystemStyleCache implements StyleProvider
     ConcurrentMap<Object, Entry> entryCache,
     Map<String, String>          shortStyleClassMap,
     String[]                     namespacePrefixes,
-    boolean                      checkModified)
+    boolean                      checkModified,
+    boolean                      isDirty)
   {
     // Next, get the fully resolved styles for this context. This will be
     // those StyleNodes that match the locale, direction, browser, portlet mode
@@ -445,7 +449,8 @@ public class FileSystemStyleCache implements StyleProvider
                                        styleNodes,
                                        shortStyleClassMap,
                                        namespacePrefixes,
-                                       checkModified);
+                                       checkModified,
+                                       isDirty);
 
     _LOG.fine("Finished processing stylesheet {0}", uris);
 
@@ -469,6 +474,11 @@ public class FileSystemStyleCache implements StyleProvider
     // Also, cache the new entry in the entry cache
     DerivationKey derivationKey = _getDerivationKey(context, document);
     entryCache.put(derivationKey, entry);
+    
+    // just in case, clear the dirty flag.
+    RenderingContext arc = RenderingContext.getCurrentInstance();
+    Skin skin = arc.getSkin();
+    skin.setDirty(false);
 
     return entry;
   }
@@ -655,17 +665,21 @@ public class FileSystemStyleCache implements StyleProvider
     StyleNode[]         styles,
     Map<String, String> shortStyleClassMap,
     String[]            namespacePrefixes,
-    boolean             checkModified)
+    boolean             checkModified,
+    boolean             isDirty)
   {
+
     // Get the current files
     List<File> outputFiles = _getOutputFiles(context, document);
 
     // If at least one output file exists, check the last modified time.
     if (!outputFiles.isEmpty())
     {
-      if (checkModified)
+      // If the skin is marked dirty, we regenerate the css even if the document's timestamp has not
+      // changed.
+      if (checkModified || isDirty)
       {
-        if (!_checkSourceModified(document, outputFiles.get(0)))
+        if (!isDirty && (checkModified && !_checkSourceModified(document, outputFiles.get(0))))
         {
           return _getFileNames(outputFiles);
         }
@@ -740,7 +754,15 @@ public class FileSystemStyleCache implements StyleProvider
     {
       if (file.exists())
       {
-        file.delete();
+        boolean success = file.delete();
+        // add warning if success is false, but continue on.
+        // I've seen the delete fail when we try to delete right after the file was created -
+        // like if the skin css file is modified and the page refreshed immediately after the
+        // app was initially run.
+        if (!success && _LOG.isWarning())
+        {
+          _LOG.warning("COULD_NOT_DELETE_FILE", file.getName());
+        }
       }
     }
   }
@@ -813,6 +835,9 @@ public class FileSystemStyleCache implements StyleProvider
       if (parentFile != null)
         parentFile.mkdirs();
 
+      // This throws a FileNotFoundException if it wasn't successfully deleted earlier, most likely
+      // due to creating, then deleting too soon after.
+      // Since the file has the hashcode in the name, it's not bad that it doesn't rewrite it.
       FileOutputStream fos = new FileOutputStream(file);
       OutputStreamWriter writer = null;
 
@@ -835,6 +860,8 @@ public class FileSystemStyleCache implements StyleProvider
     }
     catch (IOException e)
     {
+      // This might happen if we couldn't delete the css file that was already there, so we 
+      // are unable to recreate it.
       if (_LOG.isWarning())
         _LOG.warning("IOEXCEPTION_OPENNING_FILE", file);
         _LOG.warning(e);
@@ -1434,7 +1461,7 @@ public class FileSystemStyleCache implements StyleProvider
       }
 
       File outputFile = _getOutputFile(_baseFilename, _files.size() + 1);
-      // We never want to do anything other then read it or delete it:
+      // We never want to do anything other than read it or delete it:
       outputFile.setReadOnly();
 
       _files.add(outputFile);
@@ -1500,7 +1527,6 @@ public class FileSystemStyleCache implements StyleProvider
    * names do not contain html, whereas our internal style selector
    * names may. We write out the shortened version of the mapped
    * selector names to the css file.
-   * jmw.
    * @todo Need to find a better spot for this, like the skin?
    */
   private static final Map<String, String> _STYLE_KEY_MAP;
diff --git a/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts b/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
index c0c8042..f8e7a71 100644
--- a/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
+++ b/trinidad-impl/src/main/xrts/org/apache/myfaces/trinidadinternal/resource/LoggerBundle.xrts
@@ -1076,4 +1076,5 @@ The skin {0} specified on the requestMap will be used even though the consumer''
 <!-- INVALID_LOCALE_VARIANT_HAS_SLASH  -->
 <resource key="INVALID_LOCALE_VARIANT_HAS_SLASH">Invalid variant for Locale identifier {0} - cannot contain slashes to avoid XSS attack. Will use empty string for variant.</resource>
 
+<resource key="COULD_NOT_DELETE_FILE">Could not delete the file {0}</resource>
 </resources>

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 36/36: Trinidad-1795 Fix regression that caused CSS file's hash to change between server restarts by using stable hash codes for the enums.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 1d2e43d98e43f54674f91f984035532f4cf9ef2b
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Thu Apr 22 03:08:36 2010 +0000

    Trinidad-1795 Fix regression that caused CSS file's hash to change between server restarts by using stable hash codes for the enums.
---
 .../trinidadinternal/skin/AgentAtRuleMatcher.java  | 46 +++++++++++++++++++---
 1 file changed, 41 insertions(+), 5 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java
index 2689600..80cad9c 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/AgentAtRuleMatcher.java
@@ -120,6 +120,7 @@ public final class AgentAtRuleMatcher
     }
     
     _selectorAgents = browserMap;
+    _hashCode = _calculateStableHashCode(browserMap);
   }
 
   /**
@@ -263,6 +264,33 @@ public final class AgentAtRuleMatcher
     }
     
     _selectorAgents = selectorAgents;
+    _hashCode = _calculateStableHashCode(selectorAgents);
+  }
+  
+  /**
+   * Because Enums don't have stable hash codes, we can't use their hash code directly.  Instead
+   * we want to use the has code of the enum's name, which should be stable.  Here we essentially
+   * duplicate the hash code calculation of Map, using the stable hash code instead
+   * @return stable hash code
+   */
+  private static int _calculateStableHashCode(
+    Map<TrinidadAgent.Application, Set<AgentMatcher>> selectorAgents)
+  {
+    int hashCode = 0;
+    
+    // Map hash code is defined as the additive hash code of the entries
+    for (Map.Entry<TrinidadAgent.Application, Set<AgentMatcher>> entry : selectorAgents.entrySet())
+    {
+      // use the enum's name to have a stable hash code
+      int stableKeyHashCode = entry.getKey().name().hashCode();
+      
+      // entry hash code is defined as the XOR of the key and value.
+      int entryHashCode = stableKeyHashCode ^ entry.getValue().hashCode();
+      
+      hashCode += entryHashCode;
+    }
+    
+    return hashCode;
   }
   
   /**
@@ -369,9 +397,9 @@ public final class AgentAtRuleMatcher
   }
   
   @Override
-  public int hashCode()
+  public final int hashCode()
   {
-    return _selectorAgents.hashCode();
+    return _hashCode;
   }
   
   @Override
@@ -425,7 +453,7 @@ public final class AgentAtRuleMatcher
    * Immutable and thread-safe AgentMatcher that matches the supplied Version against the
    * version of a TrinidadAgent using the supplied, MAX, MIN, or EQUALS Comparison
    */
-  private static class VersionMatcher extends AgentMatcher
+  private static final class VersionMatcher extends AgentMatcher
   {
     /**
      * Creates a VersionMatcher
@@ -436,6 +464,10 @@ public final class AgentAtRuleMatcher
     {
       _version = version;
       _comparison = comparison;
+      
+      // cache the hash code.  Because enums don't have stable hash codes,
+      // we use the hash code of the name of the enum, which is stable
+      _hashCode = _version.hashCode() * 37 + _comparison.name().hashCode();
     }
     
     /**
@@ -475,9 +507,9 @@ public final class AgentAtRuleMatcher
     }
  
     @Override
-    public int hashCode()
+    public final int hashCode()
     {
-      return _version.hashCode() * 37 + _comparison.hashCode();
+      return _hashCode;
     }
     
     @Override
@@ -509,6 +541,7 @@ public final class AgentAtRuleMatcher
    
     private final Version _version;
     private final Comparison _comparison;
+    private final int _hashCode;
   }
   
   /**
@@ -638,4 +671,7 @@ public final class AgentAtRuleMatcher
   // @agent ie and (version:5), ie and (version:6), gecko. 
   // We store a map of agents and their version sets
   private final Map<TrinidadAgent.Application, Set<AgentMatcher>> _selectorAgents;
+  
+  // cached hash code
+  private final int _hashCode;
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 34/36: TRINIDAD-1757 - Allow (or support) decorator pattern for the UploadedFileProcessor

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit a455df41a9b587a3df23d97d20f23d74619e03d3
Author: Matthias Wessendorf <ma...@apache.org>
AuthorDate: Thu Apr 1 07:32:43 2010 +0000

    TRINIDAD-1757 - Allow (or support) decorator pattern for the UploadedFileProcessor
    
    Thanks to Girish Kumar Balachandran for the patch
---
 .../webapp/ChainedUploadedFileProcessor.java       | 105 +++++++++++++
 .../trinidad/webapp/UploadedFileProcessor.java     |   6 +-
 trinidad-examples/trinidad-demo/pom.xml            |   6 +
 .../myfaces/trinidaddemo/ProfanityScanner.java     |  76 +++++++++
 .../org/apache/myfaces/trinidaddemo/UIBean.java    |   5 +-
 .../src/main/webapp/WEB-INF/trinidad-config.xml    |   3 +
 .../trinidadinternal/config/ConfigParser.java      |  67 +++++++-
 ...ava => CompositeUploadedFileProcessorImpl.java} | 169 +++++++++++++++++++--
 .../config/upload/UploadedFileProcessorImpl.java   |   6 +-
 9 files changed, 418 insertions(+), 25 deletions(-)

diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ChainedUploadedFileProcessor.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ChainedUploadedFileProcessor.java
new file mode 100644
index 0000000..6a80ffb
--- /dev/null
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ChainedUploadedFileProcessor.java
@@ -0,0 +1,105 @@
+/*
+ *  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.trinidad.webapp;
+
+import java.io.IOException;
+import org.apache.myfaces.trinidad.model.UploadedFile;
+
+/**
+ * Interface responsible for processing file uploads by multiple processors one
+ * after another in a chained fashion. An Apache Trinidad application could have
+ * multiple <code>ChainedUploadedFileProcessor</code> instances. A composite UploadedFileProcessor
+ * is accessible from the {@link org.apache.myfaces.trinidad.context.RequestContext},
+ * but will be invoked automatically by the framework as needed. Developers
+ * can implement this interface and chain many of them up together using space
+ * separated class names in <code>trinidad-config.xml</code> file under
+ * <code>uploaded-file-processor</code> element. The order in which the processors
+ * will be instantated and called will be the same as how it appears inside the element.
+ * <p>
+ * To configure file uploads, the default instance supports three context
+ * initialization parameters :
+ * <ul>
+ * <li>org.apache.myfaces.trinidad.UPLOAD_MAX_MEMORY: the maximum amount of memory
+ *  that can be used in a single request to store
+ *  uploaded files. (Default of 100K)
+ * <li>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE: the maximum amount of
+ *  disk space that can be used in a single request to store
+ *  uploaded files.  (Default of 2000K)
+ * <li>org.apache.myfaces.trinidad.UPLOAD_TEMP_DIR: the name of a directory
+ *   to store temporary files.  (Defaults to the user's temporary directory)
+ * </ul>
+ * 
+ * @see org.apache.myfaces.trinidad.model.UploadedFile
+ */
+public interface ChainedUploadedFileProcessor extends UploadedFileProcessor
+{
+  /**
+   * Initialize the ChainedUploadedFileProcessor with access to the current
+   * web application context. The order of call is same as it
+   * appears in trinidad-config.xml
+   *
+   * @param context the current ServletContext or PortletContext
+   */
+  public void init(Object context);
+
+  /**
+   * Process a single uploaded file.  An implementation of this
+   *   method must process an incoming <code>UploadedFile</code> object
+   *   and return a new <code>UploadedFile</code> instance that will
+   *   remain valid for the duration of this request.  The properties of the incoming
+   *   <code>UploadedFile</code> object depends on the implementation detail of
+   *   the previous ChainedUploadedFileProcessor in the chain. In general all the
+   *   implementations must strive to return a <code>UploadedFile</code> that
+   *   should at the least comply to following:
+   *  <ul>
+   *    <li>{@link UploadedFile#getInputStream} may only be called once</li>
+   *    <li>{@link UploadedFile#getLength} returns length as it should be available</li>
+   *    <li>{@link UploadedFile#getFilename} may have been internationalized;  users should not
+   *      rely on its value, but simply use it unmodified in the
+   *      outgoing <code>UploadedFile</code></li>
+   *  </ul>
+   *  <p>
+   *  First ChainedUploadedFileProcessor in the list gets an <code>UploadedFile</code> implementation
+   *  from the framework with the above properties and the following few more:
+   *  <ul>
+   *    <li>{@link UploadedFile#getInputStream} may be called multiple times. Each call gives a new InputStream</li>
+   *    <li>{@link UploadedFile#getLength} returns length</li>
+   *  </ul>
+   *  Due to the above properties, if there was no change made to the underlying stream
+   *  significantly by the current ChainedUploadedFileProcessor, this <code>UploadedFile</code> object could
+   *  be returned intact for subsequent processing by the framework. This avoids creation of
+   *  new <code>UploadedFile</code> for simple ChainedUploadedFileProcessor implementations.
+   *  </p>
+   *  <p>
+   *  The framework guarantees that {@link UploadedFile#dispose}</code> will be called before
+   *  the request completes for each UploadedFile returned by every ChainedUploadedFileProcessor.
+   *  The order in which dispose() will be called is the revers of the order
+   *  they are declared in trinidad-config.xml. If same UploadedFile
+   *  was returned by more than one processors, dispose() will be called only once
+   *  on it. Any exception that happenes during dispose() call will be logged
+   *  as warning and the processing continues with the rest of the UploadedFile(s).
+   *  </p>
+   * @param request the current servlet or portlet request
+   * @param file a temporary file object
+   * @return a new instance of UploadedFile.  It is legal to return null,
+   *   in which case the file will not be available later in the request.
+   */
+  public UploadedFile processFile(
+    Object request, UploadedFile file) throws IOException;
+}
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UploadedFileProcessor.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UploadedFileProcessor.java
index 1be1a41..d4ac76e 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UploadedFileProcessor.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UploadedFileProcessor.java
@@ -24,8 +24,10 @@ import org.apache.myfaces.trinidad.model.UploadedFile;
 
 /**
  * Interface responsible for processing file uploads.  An Apache Trinidad
- * application has a single <code>UploadedFileProcessor</code> instance.
- * It is accessible from the {@link org.apache.myfaces.trinidad.context.RequestContext},
+ * application has a single <code>UploadedFileProcessor</code> instance. For
+ * more simpler, multiple chained UploadedFileProcessor option please look at
+ * {@link  org.apache.myfaces.trinidad.webapp.ChainedUploadedFileProcessor}.
+ * UploadedFileProcessor is accessible from the {@link org.apache.myfaces.trinidad.context.RequestContext},
  * but will be invoked automatically by the framework as needed.  Developers
  * can replace the standard processor using the
  * <code>trinidad-config.xml</code> file.
diff --git a/trinidad-examples/trinidad-demo/pom.xml b/trinidad-examples/trinidad-demo/pom.xml
index 61ea6a1..098854d 100644
--- a/trinidad-examples/trinidad-demo/pom.xml
+++ b/trinidad-examples/trinidad-demo/pom.xml
@@ -157,6 +157,12 @@
     </profile>
     
     <!-- To run jetty, issue "mvn clean -PjettyConfig jetty:run" -->
+    <!-- To Debug using a remote debugger, issue
+	    "export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000"
+	    and then issue
+	    "mvn clean -PjettyConfig jetty:run"
+	    Then connect the remote debugger to localhost:8000 -->
+
     <profile>
       <id>pluto-embedded</id>
       <dependencyManagement>
diff --git a/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/ProfanityScanner.java b/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/ProfanityScanner.java
new file mode 100644
index 0000000..e3c4388
--- /dev/null
+++ b/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/ProfanityScanner.java
@@ -0,0 +1,76 @@
+/*
+ *  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.trinidaddemo;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.apache.myfaces.trinidad.model.UploadedFile;
+import org.apache.myfaces.trinidad.webapp.ChainedUploadedFileProcessor;
+
+/**
+ * This class checks if the uploaded file contains the word "crap" in it and
+ * rejects if found.
+ * 
+ */
+public class ProfanityScanner implements ChainedUploadedFileProcessor
+{
+
+  public void init(Object context)
+  {
+    _LOG.log(Level.INFO, "ProfanityScanner just got initialized...");
+  }
+
+  public UploadedFile processFile(Object request, UploadedFile file) throws IOException
+  {
+    _LOG.log(Level.INFO, "Scanning for profanity...");
+
+    BufferedReader br = new BufferedReader(new InputStreamReader(file.getInputStream()));
+    String line;
+    try
+    {
+      while ((line = br.readLine()) != null)
+      {
+        if (line.indexOf("crap") != -1)
+        {
+          throw new IOException("ProfanityScanner rejected this file as " +
+                  "it contained the word \"crap\" in it!!!\n" + request);
+        }
+      }
+    }
+    finally
+    {
+      br.close();
+    }
+    
+    _LOG.log(Level.INFO, "Done Scanning for profanity...");
+    
+    /**
+     * Since we did not change anything in the Inputstream we got from the parameter
+     * its ok to return the same object. The file argument is backed by the buffer
+     * hence subsequent processors will be able to access the stream again.
+     */
+    return file;
+  }
+
+  static private final Logger _LOG =
+          Logger.getLogger(ProfanityScanner.class.getName());
+}
diff --git a/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/UIBean.java b/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/UIBean.java
index 298bfef..d0e3a27 100644
--- a/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/UIBean.java
+++ b/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/UIBean.java
@@ -59,7 +59,7 @@ public class UIBean
     _panelPage = panelPage;
   }
 
-  public void fileUploaded(ValueChangeEvent event)
+  public void fileUploaded(ValueChangeEvent event) throws IOException
   {
     UploadedFile file = (UploadedFile) event.getNewValue();
     if (file != null)
@@ -67,7 +67,8 @@ public class UIBean
       FacesContext context = FacesContext.getCurrentInstance();
       FacesMessage message = new FacesMessage(
          "Uploaded file " + file.getFilename() +
-         " (" + file.getLength() + " bytes)");
+         " (" + file.getLength() + " bytes)"+". Bytes available to read: " +
+         file.getInputStream().available());
       context.addMessage(event.getComponent().getClientId(context), message);
     }
   }
diff --git a/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-config.xml b/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-config.xml
index af3f1a5..ff4c222 100644
--- a/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-config.xml
+++ b/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-config.xml
@@ -33,6 +33,9 @@
   <skin-family>#{prefs.proxy.skinFamily}</skin-family>  
 
 
+  <uploaded-file-processor>org.apache.myfaces.trinidaddemo.ProfanityScanner org.apache.myfaces.trinidaddemo.ProfanityScanner</uploaded-file-processor>
+
+  <!--uploaded-file-processor>org.apache.myfaces.trinidaddemo.ProfanityScanner</uploaded-file-processor-->
 
   <!--
   <output-mode>portlet</output-mode>
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java
index 25a2b53..1730c4f 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java
@@ -20,6 +20,9 @@ package org.apache.myfaces.trinidadinternal.config;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.StringTokenizer;
@@ -36,8 +39,9 @@ import org.apache.myfaces.trinidad.context.AccessibilityProfile;
 import org.apache.myfaces.trinidad.context.RequestContext;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
+import org.apache.myfaces.trinidad.webapp.ChainedUploadedFileProcessor;
 import org.apache.myfaces.trinidad.webapp.UploadedFileProcessor;
-import org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl;
+import org.apache.myfaces.trinidadinternal.config.upload.CompositeUploadedFileProcessorImpl;
 import org.apache.myfaces.trinidadinternal.context.RequestContextBean;
 import org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils;
 import org.apache.myfaces.trinidadinternal.util.DateUtils;
@@ -102,29 +106,78 @@ public class ConfigParser
       }
     }
 
-    String className = (String)
+    String classNameString = (String)
       bean.getProperty(RequestContextBean.UPLOADED_FILE_PROCESSOR_KEY);
-    if (className != null)
+    if (classNameString != null)
     {
-      className = className.trim();
+      classNameString = classNameString.trim();
 
+      //check if this contains multiple class names for chained processors usecase.
+      // Usually the class named are separated by space char.
+      String classNames[] = classNameString.split("[ ]+");
+      if(classNames.length == 1)
+      {
+        //This could be a single processor full override usecase or a chained
+        //processor usecase that has only one processor.
       try
       {
-        Class<?> clazz = ClassLoaderUtils.loadClass(className);
+          Class<UploadedFileProcessor> clazz = (Class<UploadedFileProcessor>)
+                  ClassLoaderUtils.loadClass(classNames[0]);
+          if(ChainedUploadedFileProcessor.class.isAssignableFrom(clazz))
+          {
+            //this single chained processor case
+            ChainedUploadedFileProcessor cufp[] =
+            {
+              (ChainedUploadedFileProcessor) clazz.newInstance()
+            };
         bean.setProperty(RequestContextBean.UPLOADED_FILE_PROCESSOR_KEY,
+                  new CompositeUploadedFileProcessorImpl(Arrays.asList(cufp)));
+          }
+          else
+          {
+            //this is full override usecase
+            bean.setProperty(RequestContextBean.UPLOADED_FILE_PROCESSOR_KEY,
                          clazz.newInstance());
       }
+          
+
+        }
       catch (Exception e)
       {
         _LOG.severe("CANNOT_INSTANTIATE_UPLOADEDFILEPROCESSOR", e);
         bean.setProperty(RequestContextBean.UPLOADED_FILE_PROCESSOR_KEY,
-                         new UploadedFileProcessorImpl());
+                  new CompositeUploadedFileProcessorImpl());
+      }
+    }
+    else
+    {
+        try
+        {
+          //chained processors usecase, Multiple processors
+          List<ChainedUploadedFileProcessor> processors =
+                  new ArrayList<ChainedUploadedFileProcessor>(classNames.length);
+          for (String className : classNames)
+          {
+            Class<ChainedUploadedFileProcessor> clazz =
+                    (Class<ChainedUploadedFileProcessor>) ClassLoaderUtils.loadClass(className);
+            processors.add(clazz.newInstance());
+          }
+      bean.setProperty(RequestContextBean.UPLOADED_FILE_PROCESSOR_KEY,
+                  new CompositeUploadedFileProcessorImpl(processors));
+    }
+        catch(Exception e)
+        {
+          _LOG.severe("CANNOT_INSTANTIATE_UPLOADEDFILEPROCESSOR", e);
+          bean.setProperty(RequestContextBean.UPLOADED_FILE_PROCESSOR_KEY,
+                  new CompositeUploadedFileProcessorImpl());
+        }
       }
     }
     else
     {
+      //nothing specified, hence use default.
       bean.setProperty(RequestContextBean.UPLOADED_FILE_PROCESSOR_KEY,
-                       new UploadedFileProcessorImpl());
+              new CompositeUploadedFileProcessorImpl());
     }
 
     UploadedFileProcessor ufp = (UploadedFileProcessor)
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/CompositeUploadedFileProcessorImpl.java
similarity index 66%
copy from trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
copy to trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/CompositeUploadedFileProcessorImpl.java
index 1e0b2de..28b6da3 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/CompositeUploadedFileProcessorImpl.java
@@ -18,9 +18,14 @@
  */
 package org.apache.myfaces.trinidadinternal.config.upload;
 
+
 import java.io.File;
 import java.io.IOException;
 
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collections;
 import java.util.Map;
 
 import javax.portlet.ActionRequest;
@@ -41,15 +46,149 @@ import org.apache.myfaces.trinidadinternal.context.external.ServletApplicationMa
 import org.apache.myfaces.trinidadinternal.context.external.ServletInitParameterMap;
 import org.apache.myfaces.trinidadinternal.context.external.ServletRequestMap;
 
-
-public class UploadedFileProcessorImpl implements UploadedFileProcessor
+/**
+ * This is the default implementaion of UploadedFileProcessor. It works with
+ * multiple ChainedUploadedFileProcessor declared in trinidad-config.xml by dispatching
+ * the lifecycle calls to them in the order of declaration.
+ **/
+public class CompositeUploadedFileProcessorImpl implements UploadedFileProcessor
 {
-  public UploadedFileProcessorImpl()
+
+  public CompositeUploadedFileProcessorImpl()
   {
+    chainedProcessors = Collections.emptyList();
   }
 
+  public CompositeUploadedFileProcessorImpl(
+          List<? extends UploadedFileProcessor> chainedProcessors)
+  {
+    this.chainedProcessors = chainedProcessors;
+  }
+
+  @Override
   public void init(Object context)
   {
+    _init(context);
+    for(UploadedFileProcessor processor: chainedProcessors)
+    {
+      //call other chained processor's init
+      processor.init(context);
+    }
+
+  }
+
+  @Override
+  public UploadedFile processFile(Object request, UploadedFile tempFile) throws IOException
+  {
+    //NOTE: The following optimization was suggested at one point:
+    // Check if there are any processors in the list. If yes then call _processFile
+    // else just return tempFile we got. Calling _processFile buffers the entire
+    // file content. tempFile arg however is not buffered. If there are no
+    // ChainedUploadedFileProcessor in the list, then there is no need to buffer.
+    // BUT, the call to getLength() and dispose() on tempFile fails.
+    // This is becasue, the impl of these 2 methods are not complete -
+    // Bug - https://issues.apache.org/jira/browse/TRINIDAD-1765
+    // This bug could not be fixed due to the explanatio in the bug.
+
+    //call _processFile first. This will create the auto buffer that we want.
+    UploadedFile original = _processFile(request, tempFile);
+    if(chainedProcessors.isEmpty())
+    {
+      return original;
+    }
+    else
+    {
+      List<UploadedFile> files = new ArrayList<UploadedFile>(chainedProcessors.size()+1);
+      files.add(original);
+      for(UploadedFileProcessor processor: chainedProcessors)
+      {
+        original = processor.processFile(request, original);
+        files.add(original);
+      }
+      //the dispose order should be reverse!
+      Collections.reverse(files);
+      return new WrappedUploadedFileImpl(original, files);
+    }
+  }
+
+
+  /**
+   * Wrapper around UploadedFileImpl to listen for dispose() call and dispatch to
+   * other UploadedFileImpls returned by other chained processors
+   */
+  private static class WrappedUploadedFileImpl implements UploadedFile{
+
+    public WrappedUploadedFileImpl(UploadedFile original, List<UploadedFile> files)
+    {
+      this.original = original;
+      this.files = files;
+    }
+
+    public void dispose()
+    {
+      try
+      {
+        original.dispose();
+      }
+      catch(Exception e)
+      {
+        _LOG.warning("Exception while disposing!", e);
+        //log and continue disposing the rest.
+      }
+      if(!files.isEmpty())
+      {
+        List<UploadedFile> disposed = new ArrayList<UploadedFile>();
+        disposed.add(original);
+        for(UploadedFile file: files)
+        {
+          if(!disposed.contains(file))
+          {
+            try
+            {
+              file.dispose();
+            }
+            catch(Exception e)
+            {
+              _LOG.warning("Exception while disposing!", e);
+              //log and continue disposing the rest.
+            }
+            disposed.add(file);
+          }
+        }
+      }
+    }
+
+    public String getFilename()
+    {
+      return original.getFilename();
+    }
+
+    public String getContentType()
+    {
+      return original.getContentType();
+    }
+
+    public long getLength()
+    {
+      return original.getLength();
+    }
+
+    public Object getOpaqueData()
+    {
+      return original.getOpaqueData();
+    }
+
+    public InputStream getInputStream() throws IOException
+    {
+      return original.getInputStream();
+    }
+
+    private final UploadedFile original;
+    private final List<UploadedFile> files;
+  }
+
+  private void _init(Object context)
+  {
     ContextInfo info;
     if(_PORTLET_CONTEXT_CLASS != null && _PORTLET_CONTEXT_CLASS.isInstance(context))
     {
@@ -118,13 +257,13 @@ public class UploadedFileProcessorImpl implements UploadedFileProcessor
     }
   }
 
-  public UploadedFile processFile(
+  private UploadedFile _processFile(
       Object request, UploadedFile tempFile) throws IOException
   {
     RequestInfo info = _getRequestInfo(request);
     int contentLength = getContentLength(request);
     Map<String, Object> requestMap;
-    
+
     if (_isPortletRequestClass(request))
       requestMap = _getPortletRequestMap(request);
     else
@@ -133,20 +272,20 @@ public class UploadedFileProcessorImpl implements UploadedFileProcessor
     Long maxMemory = (Long)requestMap.get(MAX_MEMORY_PARAM_NAME);
     Long maxDiskSpace = (Long)requestMap.get(MAX_DISK_SPACE_PARAM_NAME);
     String tempDir = (String)requestMap.get(TEMP_DIR_PARAM_NAME);
-    
+
     if (maxMemory != null)
     {
       _maxMemory = maxMemory;
     }
-      
+
     if (maxDiskSpace != null)
     {
       _maxDiskSpace = maxDiskSpace;
     }
- 
+
     if (tempDir != null)
       _tempDir = tempDir;
-    
+
     if(contentLength>_maxDiskSpace)
     {
       return new ErrorFile();
@@ -195,7 +334,7 @@ public class UploadedFileProcessorImpl implements UploadedFileProcessor
 
     return length;
   }
-  
+
   private RequestInfo _getRequestInfo(Object request)
   {
     Map<String, Object> attributes;
@@ -219,7 +358,7 @@ public class UploadedFileProcessorImpl implements UploadedFileProcessor
 
     return info;
   }
-  
+
   private boolean _isPortletRequestClass(Object request)
   {
     return (_PORTLET_REQUEST_CLASS != null && _PORTLET_REQUEST_CLASS.isInstance(request));
@@ -299,11 +438,11 @@ public class UploadedFileProcessorImpl implements UploadedFileProcessor
   private static final long _DEFAULT_MAX_MEMORY = 102400;
   private static final long _DEFAULT_MAX_DISK_SPACE = 2048000;
 
-  private static final String _REQUEST_INFO_KEY = UploadedFileProcessorImpl.class.getName()+
+  private static final String _REQUEST_INFO_KEY = CompositeUploadedFileProcessorImpl.class.getName()+
     ".UploadedFilesInfo";
 
   private static final TrinidadLogger _LOG =
-    TrinidadLogger.createTrinidadLogger(UploadedFileProcessorImpl.class);
+    TrinidadLogger.createTrinidadLogger(CompositeUploadedFileProcessorImpl.class);
 
   private static final Class<?>        _PORTLET_CONTEXT_CLASS;
   private static final Class<?>       _PORTLET_REQUEST_CLASS;
@@ -328,4 +467,8 @@ public class UploadedFileProcessorImpl implements UploadedFileProcessor
     _PORTLET_CONTEXT_CLASS = context;
     _PORTLET_REQUEST_CLASS = request;
   }
+
+
+  private final List<? extends UploadedFileProcessor> chainedProcessors;
+ 
 }
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
index 1e0b2de..6c109a1 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
@@ -41,7 +41,11 @@ import org.apache.myfaces.trinidadinternal.context.external.ServletApplicationMa
 import org.apache.myfaces.trinidadinternal.context.external.ServletInitParameterMap;
 import org.apache.myfaces.trinidadinternal.context.external.ServletRequestMap;
 
-
+/**
+ * @deprecated This implementation is merged to CompositeUploadedFileProcessorImpl.
+ * This class will be removed in the next release.
+ * 
+ */
 public class UploadedFileProcessorImpl implements UploadedFileProcessor
 {
   public UploadedFileProcessorImpl()

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 33/36: TRINIDAD-1747 zip page state to reduce live memory

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 69fb48a580879d926a30ae843b2f6f5833179040
Author: Gabrielle Crawford <gc...@apache.org>
AuthorDate: Thu Mar 18 22:22:01 2010 +0000

    TRINIDAD-1747 zip page state to reduce live memory
---
 .../myfaces/trinidad/resource/LoggerBundle.xrts    |   7 +
 .../application/StateManagerImpl.java              | 366 ++++++++++++++++-----
 .../renderkit/core/CoreResponseStateManager.java   |  17 +-
 .../util/ObjectInputStreamResolveClass.java        |  51 +++
 4 files changed, 342 insertions(+), 99 deletions(-)

diff --git a/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts b/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
index 4cee30b..924d084 100644
--- a/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
+++ b/trinidad-api/src/main/xrts/org/apache/myfaces/trinidad/resource/LoggerBundle.xrts
@@ -453,4 +453,11 @@
 <!-- COMPARETO_TYPE_MISMATCH -->
 <resource key="COMPARETO_TYPE_MISMATCH">The type for "{0}" prevents it from being compared to "{1}".</resource>
 
+<!-- ZIP_STATE_FAILED -->
+<resource key="ZIP_STATE_FAILED">Failed to zip the page state.</resource>
+
+<!-- UNZIP_STATE_FAILED -->
+<resource key="UNZIP_STATE_FAILED">Failed to unzip the page state.</resource>
+
+
 </resources>
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
index a249b92..960f775 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/StateManagerImpl.java
@@ -6,9 +6,9 @@
  *  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
@@ -18,14 +18,24 @@
  */
 package org.apache.myfaces.trinidadinternal.application;
 
+import com.sun.facelets.FaceletViewHandler;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.zip.DataFormatException;
+import java.util.zip.Deflater;
+import java.util.zip.Inflater;
 
 import javax.faces.FactoryFinder;
 import javax.faces.application.StateManager;
@@ -38,23 +48,20 @@ import javax.faces.render.RenderKit;
 import javax.faces.render.RenderKitFactory;
 import javax.faces.render.ResponseStateManager;
 
+import org.apache.myfaces.trinidad.bean.util.StateUtils;
 import org.apache.myfaces.trinidad.component.UIXComponentBase;
 import org.apache.myfaces.trinidad.context.RequestContext;
+import org.apache.myfaces.trinidad.context.Window;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.util.ExternalContextUtils;
+import org.apache.myfaces.trinidad.util.TransientHolder;
+import org.apache.myfaces.trinidadinternal.context.RequestContextImpl;
+import org.apache.myfaces.trinidadinternal.context.TrinidadPhaseListener;
 import org.apache.myfaces.trinidadinternal.util.LRUCache;
+import org.apache.myfaces.trinidadinternal.util.ObjectInputStreamResolveClass;
 import org.apache.myfaces.trinidadinternal.util.SubKeyMap;
 import org.apache.myfaces.trinidadinternal.util.TokenCache;
 
-import com.sun.facelets.FaceletViewHandler;
-
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectOutputStream;
-
-import org.apache.myfaces.trinidad.bean.util.StateUtils;
-import org.apache.myfaces.trinidad.context.Window;
-import org.apache.myfaces.trinidadinternal.context.RequestContextImpl;
-import org.apache.myfaces.trinidadinternal.context.TrinidadPhaseListener;
 
 /**
  * StateManager that handles a hybrid client/server strategy:  a
@@ -114,6 +121,15 @@ public class StateManagerImpl extends StateManagerWrapper
     "org.apache.myfaces.trinidad.CLIENT_STATE_MAX_TOKENS";
 
   /**
+     * Servlet context initialization parameter used by
+     * StateManagerImpl to decide whether to zip state.
+     * Valid values are true and false
+     */
+    static public final String COMPRESS_VIEW_STATE_PARAM_NAME =
+      "org.apache.myfaces.trinidadinternal.COMPRESS_VIEW_STATE";
+
+
+  /**
    * Value indicating that only a simple token will be stored
    * on the client.
    */
@@ -130,7 +146,7 @@ public class StateManagerImpl extends StateManagerWrapper
   {
     _delegate = delegate;
   }
-  
+
   @Override
   protected StateManager getWrapped()
   {
@@ -142,13 +158,13 @@ public class StateManagerImpl extends StateManagerWrapper
   public Object saveView(FacesContext context)
   {
     assert(context != null);
-    
+
     if(isSavingStateInClient(context))
     {
       SerializedView view = _saveSerializedView(context);
       return new Object[]{view.getStructure(), view.getState()};
     }
-    
+
     return super.saveView(context);
   }
 
@@ -156,12 +172,12 @@ public class StateManagerImpl extends StateManagerWrapper
   public SerializedView saveSerializedView(FacesContext context)
   {
     assert(context != null);
-    
+
     if(isSavingStateInClient(context))
     {
       return _saveSerializedView(context);
     }
-    
+
     return _delegate.saveSerializedView(context);
   }
 
@@ -177,7 +193,7 @@ public class StateManagerImpl extends StateManagerWrapper
     Object state = component.processSaveState(context);
     return new PageState(context, structure, state, null);
   }
-  
+
   /**
    * Take an object created by saveComponentTree()
    * and instantiate it as a UIComponent.
@@ -253,7 +269,7 @@ public class StateManagerImpl extends StateManagerWrapper
       root.processRestoreState(context, state);
 
     return root;
-  }  
+  }
 
   @SuppressWarnings({"unchecked", "deprecation"})
   private SerializedView _saveSerializedView(FacesContext context)
@@ -314,10 +330,10 @@ public class StateManagerImpl extends StateManagerWrapper
         Map<String, Object> sessionMap = extContext.getSessionMap();
 
         RequestContext trinContext = RequestContext.getCurrentInstance();
-        
+
         // get view cache key with "." separator suffix to separate the SubKeyMap keys
         String subkey = _getViewCacheKey(extContext, trinContext, _SUBKEY_SEPARATOR);
-        
+
         Map<String, PageState> stateMap = new SubKeyMap<PageState>(sessionMap, subkey);
 
         // Sadly, we can't save just a SerializedView, because we should
@@ -345,7 +361,7 @@ public class StateManagerImpl extends StateManagerWrapper
 
           sessionMap.put(activePageStateKey, pageState);
         }
-        
+
         String requestToken = _getRequestTokenForResponse(context);
         // If we have a cached token that we want to reuse,
         // and that token hasn't disappeared from the cache already
@@ -378,7 +394,7 @@ public class StateManagerImpl extends StateManagerWrapper
       {
         // use null viewRoot since this state is shared across users:
         PageState applicationState = new PageState(context, structure, state, null);
-        
+
         // If we need to, stash the state off in our cache
         if (!dontSave)
         {
@@ -399,7 +415,7 @@ public class StateManagerImpl extends StateManagerWrapper
       // Create a "tokenView" which abuses SerializedView to store
       // our token only
       view = new SerializedView(token, null);
-      
+
       // And store the token for this request
       extContext.getRequestMap().put(_REQUEST_STATE_TOKEN_KEY, token);
     }
@@ -425,9 +441,9 @@ public class StateManagerImpl extends StateManagerWrapper
   {
     context.getExternalContext().getRequestMap().put(
             _PINNED_STATE_TOKEN_KEY, stateToken);
-    
+
   }
-  
+
   /**
    * @return the state token for the current request
    */
@@ -436,24 +452,24 @@ public class StateManagerImpl extends StateManagerWrapper
     return (String) context.getExternalContext().getRequestMap().get(
             _REQUEST_STATE_TOKEN_KEY);
   }
-  
-  
+
+
   /**
    * Mark the the incoming request token should be used for the response
    */
   @SuppressWarnings("unchecked")
   static public void reuseRequestTokenForResponse(ExternalContext ec)
   {
-    ec.getRequestMap().put(_REUSE_REQUEST_TOKEN_FOR_RESPONSE_KEY, Boolean.TRUE);    
+    ec.getRequestMap().put(_REUSE_REQUEST_TOKEN_FOR_RESPONSE_KEY, Boolean.TRUE);
   }
-  
+
   /**
    * Clears the flag indicating that the old request token should be used for the response.
    */
   @SuppressWarnings("unchecked")
   static public void clearReuseRequestTokenForResponse(ExternalContext ec)
   {
-    ec.getRequestMap().remove(_REUSE_REQUEST_TOKEN_FOR_RESPONSE_KEY);    
+    ec.getRequestMap().remove(_REUSE_REQUEST_TOKEN_FOR_RESPONSE_KEY);
   }
 
   /**
@@ -489,8 +505,8 @@ public class StateManagerImpl extends StateManagerWrapper
 
     return (String) token;
   }
-    
-  
+
+
   @Override @SuppressWarnings("deprecation")
   public void writeState(FacesContext context,
                          SerializedView state) throws IOException
@@ -504,8 +520,8 @@ public class StateManagerImpl extends StateManagerWrapper
                                 String renderKitId)
   {
     final ExternalContext extContext = context.getExternalContext();
-    
-    // If we're being asked to execute a "return" event from, say, a dialog, always 
+
+    // If we're being asked to execute a "return" event from, say, a dialog, always
     // restore the "launch view", which was set over in the TrinidadFilter.
     UIViewRoot launchView = (UIViewRoot)
                             extContext.getRequestMap().remove(RequestContextImpl.LAUNCH_VIEW);
@@ -514,7 +530,7 @@ public class StateManagerImpl extends StateManagerWrapper
       TrinidadPhaseListener.markPostback(context);
       return launchView;
     }
-    
+
     if (!isSavingStateInClient(context))
       return _delegate.restoreView(context, viewId, renderKitId);
 
@@ -559,10 +575,10 @@ public class StateManagerImpl extends StateManagerWrapper
             if (viewState != null)
               perSessionCache.put(viewId, viewState);
           }
-          
+
           // If the view was found in the application cache then we
           // know it would be unsafe to use its locale for this session.
-          // Same conclusion, however, even if found in the per-session 
+          // Same conclusion, however, even if found in the per-session
           // cache, since the latter is just a mirror of the former.
           recalculateLocale = true;
         }
@@ -573,7 +589,7 @@ public class StateManagerImpl extends StateManagerWrapper
         String subkey = _getViewCacheKey(extContext,
                                          RequestContext.getCurrentInstance(),
                                          _SUBKEY_SEPARATOR);
-        
+
         Map<String, PageState> stateMap = new SubKeyMap<PageState>(
                          extContext.getSessionMap(),
                          subkey);
@@ -649,7 +665,7 @@ public class StateManagerImpl extends StateManagerWrapper
 
         if (state != null)
           root.processRestoreState(context, state);
-        
+
         if (recalculateLocale)
         {
           // Ensure that locale gets re-calculated when next fetched.
@@ -716,7 +732,7 @@ public class StateManagerImpl extends StateManagerWrapper
   private TokenCache _getViewCache(FacesContext context)
   {
     ExternalContext extContext = context.getExternalContext();
-    
+
     return TokenCache.getTokenCacheFromSession(context,
                                                _getViewCacheKey(extContext,
                                                                 RequestContext.getCurrentInstance(),
@@ -725,7 +741,7 @@ public class StateManagerImpl extends StateManagerWrapper
                                                _getCacheSize(extContext));
   }
 
-  
+
 
   /**
    * Returns a key suitable for finding the per-window active page state key
@@ -739,7 +755,7 @@ public class StateManagerImpl extends StateManagerWrapper
   {
     return _getPerWindowCacheKey(extContext, trinContext, _ACTIVE_PAGE_STATE_SESSION_KEY, null);
   }
-  
+
   /**
    * Returns a key suitable for finding the per-window cache key
    * @param extContext
@@ -754,7 +770,7 @@ public class StateManagerImpl extends StateManagerWrapper
   {
     return _getPerWindowCacheKey(extContext, trinContext, _VIEW_CACHE_KEY, suffix);
   }
-  
+
   /**
    * Returns a key of the form <prefix>.<windowid><suffix> if a window and a suffix are available
    *                           <prefix>.<window> if just a window is available
@@ -772,18 +788,18 @@ public class StateManagerImpl extends StateManagerWrapper
     Character suffix)
   {
     Window currWindow = trinContext.getWindowManager().getCurrentWindow(eContext);
-    
+
     // if we have a current window or a suffix, we need a StringBuilder to calculate the cache key
     if ((currWindow != null) || (suffix != null))
     {
       // get the window id and the extra size neeeded to store it and its separator
       String windowId;
       int windowPartSize;
-    
+
       if (currWindow != null)
       {
         windowId = currWindow.getId();
-        
+
         // add 1 for separator
         windowPartSize = windowId.length() + 1;
       }
@@ -792,28 +808,28 @@ public class StateManagerImpl extends StateManagerWrapper
         windowId = null;
         windowPartSize = 0;
       }
-      
+
       int builderSize =  prefix.length() + windowPartSize;
-      
+
       // add extra space for the suffix Character
       if (suffix != null)
         builderSize += 1;
-      
+
       // add the constant part to the StringBuilder
       StringBuilder keyBuilder = new StringBuilder(builderSize);
       keyBuilder.append(prefix);
-      
+
       // add the windowId and its separator
       if (currWindow != null)
       {
         keyBuilder.append('.');
         keyBuilder.append(windowId);
       }
-      
+
       // add the suffix if any
       if (suffix != null)
         keyBuilder.append(suffix);
-      
+
       return keyBuilder.toString();
     }
     else
@@ -880,7 +896,7 @@ public class StateManagerImpl extends StateManagerWrapper
       return cache;
     }
   }
-  
+
   @SuppressWarnings("unchecked")
   static private Map<String, PageState> _getPerSessionApplicationViewCache(FacesContext context)
   {
@@ -943,7 +959,7 @@ public class StateManagerImpl extends StateManagerWrapper
       }
       if (Boolean.TRUE.equals(_useApplicationViewCache))
       {
-         _LOG.severe("USE_APPLICATION_VIEW_CACHE_UNSUPPORTED");        
+         _LOG.severe("USE_APPLICATION_VIEW_CACHE_UNSUPPORTED");
       }
       return _useApplicationViewCache.booleanValue();
     }
@@ -1016,18 +1032,18 @@ public class StateManagerImpl extends StateManagerWrapper
       // Nope, guess it's a facet
       // 2006-08-02: -= Simon Lessard
       //             Not 1.5 structure and inefficient loop
-      //             values() is more efficient as you don't have 
+      //             values() is more efficient as you don't have
       //             to do a second lookup for the value.
       Map<String, UIComponent> facets = parent.getFacets();
-      for(Iterator<UIComponent> facetIter = facets.values().iterator(); 
+      for(Iterator<UIComponent> facetIter = facets.values().iterator();
           facetIter.hasNext();)
       {
         if(facetIter.next() == kid)
         {
           facetIter.remove();
           // FIXME: -= Simon Lessard
-          //        Is that continue need to labeled to go all the way up to 
-          //        the first while? Currently it won't cause any problem, but 
+          //        Is that continue need to labeled to go all the way up to
+          //        the first while? Currently it won't cause any problem, but
           //        it's a performance loss.
           continue;
         }
@@ -1083,11 +1099,11 @@ public class StateManagerImpl extends StateManagerWrapper
     {
       if (viewRoot == null)
         throw new NullPointerException();
-      
+
       _viewRoot = viewRoot;
       _viewRootState = viewRoot.saveState(context);
     }
-    
+
     public UIViewRoot getViewRoot()
     {
       return _viewRoot;
@@ -1097,7 +1113,7 @@ public class StateManagerImpl extends StateManagerWrapper
     {
       return _viewRootState;
     }
-   
+
     private final UIViewRoot _viewRoot;
     private final Object _viewRootState;
   }
@@ -1106,8 +1122,8 @@ public class StateManagerImpl extends StateManagerWrapper
   {
     private static final long serialVersionUID = 1L;
 
-    private final Object _structure, _state;
-    
+    private Object _structure, _state;
+
     // use transient since UIViewRoots are not Serializable.
     private transient ViewRootState _cachedState;
 
@@ -1115,22 +1131,33 @@ public class StateManagerImpl extends StateManagerWrapper
     {
       _structure = structure;
       _state = state;
-      
-      // if component tree serialization checking is on (in order to validate
-      // fail over support, attempt to Serialize all of the component state
-      //  immediately
-      if (StateUtils.checkComponentTreeStateSerialization(fc))
+
+      boolean zipState = _zipState(fc);
+
+      if (zipState || StateUtils.checkComponentTreeStateSerialization(fc))
       {
-        try
+
+        if (zipState)
         {
-          new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(state);
+          // zip the page state. This will also catch any serialization problems.
+          _zipToBytes(state, structure);
         }
-        catch (IOException e)
-        {          
-          throw new RuntimeException(_LOG.getMessage("COMPONENT_TREE_SERIALIZATION_FAILED"), e);
+        else
+        {
+          // if component tree serialization checking is on (in order to validate
+          // fail over support, attempt to Serialize all of the component state
+          //  immediately
+          try
+          {
+            new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(state);
+          }
+          catch (IOException e)
+          {
+            throw new RuntimeException(_LOG.getMessage("COMPONENT_TREE_SERIALIZATION_FAILED"), e);
+          }
         }
       }
-                  
+
       // we need this state, as we are going to recreate the UIViewRoot later. see
       // the popRoot() method:
       _cachedState = (root != null)
@@ -1140,11 +1167,21 @@ public class StateManagerImpl extends StateManagerWrapper
 
     public Object getStructure()
     {
+      if (_zipState(FacesContext.getCurrentInstance()))
+      {
+        return _unzipBytes((byte[])_structure);
+      }
+
       return _structure;
     }
 
     public Object getState()
     {
+      if (_zipState(FacesContext.getCurrentInstance()))
+      {
+        return _unzipBytes((byte[])_state);
+      }
+
       return _state;
     }
 
@@ -1155,7 +1192,7 @@ public class StateManagerImpl extends StateManagerWrapper
         _cachedState = null;
       }
     }
-    
+
     @SuppressWarnings("unchecked")
     public UIViewRoot popRoot(FacesContext fc)
     {
@@ -1176,7 +1213,7 @@ public class StateManagerImpl extends StateManagerWrapper
           _cachedState = null;
         }
       }
-      
+
       if (root != null)
       {
         // If an error happens during updateModel, JSF 1.1 does not
@@ -1185,11 +1222,11 @@ public class StateManagerImpl extends StateManagerWrapper
         // so to clear the events, we create a new UIViewRoot.
         // must get the UIViewRoot from the application so that
         // we pick up any custom ViewRoot defined in faces-config.xml:
-        UIViewRoot newRoot = (UIViewRoot) 
+        UIViewRoot newRoot = (UIViewRoot)
           fc.getApplication().createComponent(UIViewRoot.COMPONENT_TYPE);
-        
+
         //This code handles automatic namespacing in a JSR-301 environment
-        if(ExternalContextUtils.isPortlet(fc.getExternalContext())) 
+        if(ExternalContextUtils.isPortlet(fc.getExternalContext()))
         {
           //IMPORTANT: To avoid introducing a runtime dependency on the bridge,
           //this method should only be executed when we have a portlet
@@ -1200,7 +1237,7 @@ public class StateManagerImpl extends StateManagerWrapper
           newRoot = PortletUtils.getPortletViewRoot(newRoot);
         }
 
-        
+
         // must call restoreState so that we setup attributes, listeners,
         // uniqueIds, etc ...
         newRoot.restoreState(fc, viewRootState);
@@ -1216,9 +1253,170 @@ public class StateManagerImpl extends StateManagerWrapper
         newRoot.getChildren().addAll(temp);
         return newRoot;
       }
-      
+
       return null;
-    }    
+    }
+
+    private boolean _zipState(FacesContext fc)
+    {
+      // default is false
+      Object zipStateObject = 
+                           fc.getExternalContext().getInitParameter(COMPRESS_VIEW_STATE_PARAM_NAME);
+
+      if (zipStateObject == null)
+        return false;
+
+      return zipStateObject.toString().equalsIgnoreCase("true");
+    }
+
+    private Object _unzipBytes(byte[] zippedBytes)
+    {
+      Inflater decompressor = null;
+      ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+      Map<String,Object> sessionMap  = externalContext.getSessionMap();
+        
+      try
+      {
+        //Get inflater from session cope
+        TransientHolder<Inflater> th = 
+                              (TransientHolder<Inflater>)sessionMap.remove("PAGE_STATE_INFLATER");
+        
+        if (th != null)
+        {
+          decompressor = th.getValue();
+        }
+        
+        if(decompressor == null) 
+        {
+          decompressor = new Inflater();
+        }
+        
+		    decompressor.setInput(zippedBytes);
+        ByteArrayOutputStream bos = new ByteArrayOutputStream(zippedBytes.length);
+        byte[] buf = new byte[zippedBytes.length*5];
+
+        while (!decompressor.finished())
+        {
+	        try
+		      {
+		        int count = decompressor.inflate(buf);
+		        bos.write(buf, 0, count);
+		      }
+		      catch (DataFormatException e)
+		      {
+            throw new RuntimeException(_LOG.getMessage("UNZIP_STATE_FAILED"), e); 
+          }
+		    }
+
+        ByteArrayInputStream baos = new ByteArrayInputStream(bos.toByteArray());
+        ObjectInputStream ois = new ObjectInputStreamResolveClass(baos);
+        Object unzippedState = ois.readObject();
+        ois.close();
+        return unzippedState;
+      }
+      catch(ClassNotFoundException cnfe)
+      {
+        throw new RuntimeException(_LOG.getMessage("UNZIP_STATE_FAILED"), cnfe);
+      }
+      catch(IOException ioe)
+      {
+        throw new RuntimeException(_LOG.getMessage("UNZIP_STATE_FAILED"), ioe);
+      }
+      finally 
+      {
+        //Reset and put back
+        if(decompressor != null)
+        {
+          decompressor.reset();
+          TransientHolder<Inflater> th = TransientHolder.newTransientHolder(decompressor);
+          sessionMap.put("PAGE_STATE_INFLATER", th);
+        }
+      }
+    }
+
+    private void _zipToBytes(Object state, Object structure)
+    {
+      Deflater compresser = null;
+      ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
+      Map<String,Object> sessionMap  = externalContext.getSessionMap();
+      
+      try
+      {
+        //Get deflater from session cope
+        TransientHolder<Deflater> th = 
+                              (TransientHolder<Deflater>)sessionMap.remove("PAGE_STATE_DEFLATER");
+        
+        if (th != null)
+        {
+          compresser = th.getValue();
+        }
+        
+        if(compresser == null) 
+        {
+          compresser = new Deflater(Deflater.BEST_SPEED);
+        }
+        
+        //Serialize state
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ObjectOutputStream oos = new ObjectOutputStream(baos);
+        
+        oos.writeObject(state);
+        oos.flush();
+        oos.close();
+
+        byte[] ret =  baos.toByteArray();
+        compresser.setInput(ret);
+		    compresser.finish();
+
+        baos.reset();
+        byte[] buf = new byte[ret.length/5];
+
+        while (!compresser.finished())
+        {
+			    int count = compresser.deflate(buf);
+			    baos.write(buf, 0, count);
+		    }
+
+        _state = baos.toByteArray();
+        
+        //Serialize structure
+        baos.reset();
+        oos = new ObjectOutputStream(baos);
+        compresser.reset();
+        
+        oos.writeObject(structure);
+        oos.flush();
+        oos.close();
+        
+        ret =  baos.toByteArray();
+        compresser.setInput(ret);
+        compresser.finish();
+        
+        baos.reset();
+
+        while (!compresser.finished())
+        {
+          int count = compresser.deflate(buf);
+          baos.write(buf, 0, count);
+        }
+
+        _structure = baos.toByteArray();
+      }
+      catch (IOException e)
+      {
+        throw new RuntimeException(_LOG.getMessage("ZIP_STATE_FAILED"), e);
+      }
+      finally 
+      {
+        //Reset and put back
+        if(compresser != null)
+        {
+          compresser.reset();
+          TransientHolder<Deflater> th = TransientHolder.newTransientHolder(compresser);
+          sessionMap.put("PAGE_STATE_DEFLATER", th);
+        }
+      }
+    }
   }
 
   private final StateManager _delegate;
@@ -1227,11 +1425,11 @@ public class StateManagerImpl extends StateManagerWrapper
   private       Boolean      _structureGeneratedByTemplate;
 
   private static final Character _SUBKEY_SEPARATOR = new Character('.');
-  
+
   private static final int _DEFAULT_CACHE_SIZE = 15;
 
   private static final Object _APPLICATION_VIEW_CACHE_LOCK = new Object();
-  
+
   // base key used to identify the view cache.  The window name, if any, is appended to this
   private static final String _VIEW_CACHE_KEY =
     "org.apache.myfaces.trinidadinternal.application.VIEW_CACHE";
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java
index 9055d48..cc8ce8d 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/CoreResponseStateManager.java
@@ -46,6 +46,7 @@ import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.util.Base64InputStream;
 import org.apache.myfaces.trinidad.util.Base64OutputStream;
 import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
+import org.apache.myfaces.trinidadinternal.util.ObjectInputStreamResolveClass;
 
 /**
  * ResponseStateManager implementation for the Core RenderKit.
@@ -184,21 +185,7 @@ public class CoreResponseStateManager extends ResponseStateManager
         try
         {
           ObjectInputStream ois;
-          ois = new ObjectInputStream( new GZIPInputStream( b64_in,
-                                                            _BUFFER_SIZE ))
-            {
-              protected Class<?> resolveClass(ObjectStreamClass desc)
-                                       throws IOException,
-                                              ClassNotFoundException
-              {
-                // TRINIDAD-1062 It has been noticed that in OC4J and Weblogic that the
-                // classes being resolved are having problems by not finding
-                // them using the context class loader. Therefore, we are adding
-                // this work-around until the problem with these application
-                // servers can be better understood
-                return ClassLoaderUtils.loadClass(desc.getName());
-              }
-            };
+          ois = new ObjectInputStreamResolveClass( new GZIPInputStream( b64_in, _BUFFER_SIZE ));
 
           Object structure = ois.readObject();
           Object state = ois.readObject();
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/ObjectInputStreamResolveClass.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/ObjectInputStreamResolveClass.java
new file mode 100644
index 0000000..ecfb53d
--- /dev/null
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/ObjectInputStreamResolveClass.java
@@ -0,0 +1,51 @@
+/*
+ *  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.trinidadinternal.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamClass;
+
+import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
+
+public class ObjectInputStreamResolveClass extends ObjectInputStream
+{
+  public ObjectInputStreamResolveClass()  throws IOException, SecurityException
+  {
+    super();
+  }
+
+  public ObjectInputStreamResolveClass(InputStream in) throws IOException 
+  {
+    super(in);
+  }
+  
+  protected Class<?> resolveClass(ObjectStreamClass desc)
+                           throws IOException,
+                                  ClassNotFoundException
+  {
+    // TRINIDAD-1062 It has been noticed that in OC4J and Weblogic that the
+    // classes being resolved are having problems by not finding
+    // them using the context class loader. Therefore, we are adding
+    // this work-around until the problem with these application
+    // servers can be better understood
+    return ClassLoaderUtils.loadClass(desc.getName());
+  }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 02/36: TRINIDAD-1041 Support locale-specific styles submitted patch for Marius Petoi This also includes removes duplicate @agent in purpleSkin.css adds a text explaining locale skin in panelPageSkinDemo.jspx fixed error in old @agent doc in skinning.xml 1.2.12.2-branch

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 99b3c68c321101fe50af9d691d603d0203ef0501
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Wed Jan 6 01:07:55 2010 +0000

    TRINIDAD-1041 Support locale-specific styles
    submitted patch for Marius Petoi
    This also includes
    removes duplicate @agent in purpleSkin.css
    adds a text explaining locale skin in panelPageSkinDemo.jspx
    fixed error in old @agent doc in skinning.xml
    1.2.12.2-branch
---
 src/site/xdoc/devguide/skinning.xml                | 22 ++++++--
 .../src/main/webapp/WEB-INF/trinidad-skins.xml     |  8 +++
 .../src/main/webapp/demos/panelPageSkinDemo.jspx   |  3 +-
 .../src/main/webapp/skins/purple/purpleSkin.css    |  4 ++
 .../skin/SkinCSSDocumentHandler.java               | 60 +++++++++++++++++-----
 .../trinidadinternal/skin/SkinStyleSheetNode.java  | 23 +++++++--
 .../skin/SkinStyleSheetParserUtils.java            |  2 +-
 .../style/xml/parse/StyleSheetNode.java            |  5 +-
 .../style/xml/parse/StyleSheetNodeParser.java      | 34 +++---------
 .../style/xml/parse/StyleSheetNodeEqualsTest.java  | 13 +++--
 10 files changed, 116 insertions(+), 58 deletions(-)

diff --git a/src/site/xdoc/devguide/skinning.xml b/src/site/xdoc/devguide/skinning.xml
index fc428d8..eed99c8 100644
--- a/src/site/xdoc/devguide/skinning.xml
+++ b/src/site/xdoc/devguide/skinning.xml
@@ -889,6 +889,11 @@ public class SkinTranslationMapDemo
         This is to define styles only for a particular accessibility profile.  See the <a href="configuration.html#accessibility-profile">Configuring Apache Trinidad</a> chapter for information on setting the accessibility profile.
         </li>
         <li>
+        <strong>@locale</strong> {/skin definitions go here/} - >
+        A certain locale must be specified, either only the language or both the language and the country.
+        This is to define styles only for a particular language and country.
+        </li>
+        <li>
         <strong>:rtl</strong> - >  pseudo-class to create a style or icon definition when the browser 
         is in a right-to-left language. The best example is that of images that are not symmetric.
         If you set a skin selector that uses a asymmetrical image, when you set your browser to
@@ -896,7 +901,7 @@ public class SkinTranslationMapDemo
         you use the :rtl pseudo-class at the end of your selector and point it to a flipped-looking image.
         </li>
         <li>
-        :lang or @locale  - >  Not yet implemented in Trinidad.         
+        :lang - >  Not yet implemented in Trinidad.         
         </li>          
         </ul>
           
@@ -920,16 +925,27 @@ public class SkinTranslationMapDemo
         }
 
         /* for ie 5 and 6, we also need some margins.*/
-        @agent ie (version: 5) and (version: 6)
+        @agent ie and (version: 5), ie and (version: 6)
         {
           af|someComponent {margin: 5px;}
         }
         
         /* for Firefox 3 (gecko 1.9) use a smaller margin.*/
-        @agent gecko (version: 1.9)
+        @agent gecko and (version: 1.9)
         {
           af|someComponent {margin: 4px;}
         }
+
+        @locale en, de {
+           af|commandButton {
+              color: red;
+           }
+         }
+         @locale ro-RO {
+           af|commandButton {
+             color: blue;
+           }
+         }
         
         /* The following selectors are for all platforms and all browsers */
         
diff --git a/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml b/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml
index 73d141d..756dd3c 100644
--- a/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml
+++ b/trinidad-examples/trinidad-demo/src/main/webapp/WEB-INF/trinidad-skins.xml
@@ -101,4 +101,12 @@
       <style-sheet-name>skins/accdemo/accdemo.css</style-sheet-name>
     </skin>
 
+    <!-- A skin which demonstrates locale features,
+         eg. @locale -->
+    <skin>
+      <id>localedemo.desktop</id>
+      <family>localeDemo</family>
+      <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
+      <style-sheet-name>skins/localedemo/localedemo.css</style-sheet-name>
+    </skin>
 </skins>
diff --git a/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx b/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
index cfe84f1..07b4ac2 100644
--- a/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
+++ b/trinidad-examples/trinidad-demo/src/main/webapp/demos/panelPageSkinDemo.jspx
@@ -86,6 +86,7 @@
                   <tr:selectItem label="purpleBigFont" value="purpleBigFont"/>
                   <tr:selectItem label="beach" value="beach"/>
                   <tr:selectItem label="suede" value="suede"/>
+                  <tr:selectItem label="locale" value="localeDemo"/>
                 </tr:selectOneChoice>
                 <tr:commandButton text="Go"/>
                 <tr:goLink id="goLinkId" text="EmailablePageMode" 
@@ -156,7 +157,7 @@
                     </tr:showDetailItem>
                     <tr:showDetailItem text="Tab 2" disclosed="true">
                       <tr:panelHeader text="PanelTabbed details">
-                        <tr:outputText value="Everything in Camping  is on sale!  Enjoy huge savings on our most popular tents                     and sleeping bags. We even have dried food and mattresses"
+                        <tr:outputText value="In Locale Skin, commandButton text is red in en and de locales and blue in ro-RO. Test it out!"
                                        styleClass="mainContentText"/>
                         <tr:panelGroupLayout layout="horizontal">
                           <tr:goButton text="Sorry, Disabled" disabled="true"/>
diff --git a/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css b/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
index 7a25ad1..ed1aeae 100644
--- a/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
+++ b/trinidad-examples/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
@@ -920,6 +920,10 @@ af|tree {
   af|selectBooleanCheckbox::label {color: aqua}
 }
 
+@agent gecko and (min-version:1.9.*) {
+  af|selectBooleanCheckbox::label {color: Orange;}
+}
+
 @agent gecko and (min-version:0.8.1.*)  and (max-version:0.9.1.*), gecko and (version:5), ie and (min-version:5.*) and (max-version:8), gecko and (version: 2.9.1.*){
   af|selectBooleanCheckbox::label {color: fuschia}
 }
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSDocumentHandler.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSDocumentHandler.java
index 228f54a..84108b7 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSDocumentHandler.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinCSSDocumentHandler.java
@@ -19,13 +19,17 @@
 package org.apache.myfaces.trinidadinternal.skin;
 
 import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.ArrayList;
+import java.util.Locale;
 import java.util.Set;
+import java.util.HashSet;
+import java.util.HashMap;
+import java.util.LinkedList;
 
 import org.apache.myfaces.trinidad.context.Version;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
@@ -110,6 +114,7 @@ public class SkinCSSDocumentHandler
        CompleteSelectorNode node =
          _createCompleteSelectorNode(selector,
                                      _propertyNodeList,
+                                     _locales,
                                      _agentAtRuleMatcher,
                                      _selectorPlatforms,
                                      _getSelectorAccProperties());
@@ -187,6 +192,10 @@ public class SkinCSSDocumentHandler
       {
         _parseCustomAtRule(_AT_PLATFORM, atRule);
       }
+      else if (atRule.startsWith(_AT_LOCALE))
+      {
+        _parseCustomAtRule(_AT_LOCALE, atRule);
+      }
       else if (atRule.startsWith(_AT_ACC_PROFILE))
       {
         _parseCustomAtRule(_AT_ACC_PROFILE, atRule);
@@ -202,8 +211,8 @@ public class SkinCSSDocumentHandler
    */
   private void _parseCustomAtRule(String type, String atRule)
   {
-    // get the @agent agents, they are deliminated by commas
-    // parse out the content
+    // get the @agent agents, @platform platforms or the @locale locales 
+    // they are deliminated by commas parse out the content
     // save the atRule type, so the document handler code can get to it.
     // run this through parser again
     String content = _getAtRuleContent(atRule);
@@ -226,6 +235,8 @@ public class SkinCSSDocumentHandler
       _agentAtRuleMatcher = null;
     else if (_AT_PLATFORM.equals(type))
       _selectorPlatforms = null;
+    else if (_AT_LOCALE.equals(type))
+      _locales = null;
     else if (_AT_ACC_PROFILE.equals(type))
     {
       assert(!_selectorAccPropertiesStack.isEmpty());
@@ -240,6 +251,7 @@ public class SkinCSSDocumentHandler
   private CompleteSelectorNode _createCompleteSelectorNode(
     String                     selector,
     List<PropertyNode>         propertyNodeList,
+    Set<Locale>                locales,
     AgentAtRuleMatcher         agentMatcher,
     int[]                      selectorPlatforms,
     Set<String>                selectorAccProperties)
@@ -266,6 +278,7 @@ public class SkinCSSDocumentHandler
       new CompleteSelectorNode(
         selector,
         propertyNodeList,
+        locales,
         direction,
         agentMatcher,
         selectorPlatforms,
@@ -293,6 +306,7 @@ public class SkinCSSDocumentHandler
       int direction = completeSelectorNode.getDirection();
       AgentAtRuleMatcher agentMatcher = completeSelectorNode.getAgentMatcher();
       int[] platforms = completeSelectorNode.getPlatforms();
+      Set<Locale> locales = completeSelectorNode.getLocales();
       Set<String> accProperties = completeSelectorNode.getAccessibilityProperties();
 
       // loop through the skinStyleSheetNodeList to find a match
@@ -304,7 +318,7 @@ public class SkinCSSDocumentHandler
       for (int i = skinStyleSheetNodes.size() - 1; i >= 0 && !match; --i)
       {
         SkinStyleSheetNode ssNode = skinStyleSheetNodes.get(i);
-        match = ssNode.matches(direction, agentMatcher, platforms, accProperties);
+        match = ssNode.matches(direction, agentMatcher, platforms, locales, accProperties);
         if (match)
           ssNode.add(completeSelectorNode.getSkinSelectorPropertiesNode());
       }
@@ -313,7 +327,7 @@ public class SkinCSSDocumentHandler
       {
         // no matching stylesheet node found, so create a new one
         SkinStyleSheetNode ssNode =
-         new SkinStyleSheetNode(namespaceMap, direction, agentMatcher, platforms, accProperties);
+         new SkinStyleSheetNode(namespaceMap, direction, locales, agentMatcher, platforms, accProperties);
         ssNode.add(completeSelectorNode.getSkinSelectorPropertiesNode());
         skinStyleSheetNodes.add(ssNode);
       }
@@ -324,7 +338,7 @@ public class SkinCSSDocumentHandler
   /**
    * Initialized at rule target types.
    * 
-   * @param type type of the at rule. _AT_AGENT, _AT_PLATFORM, or _AT_ACC_PROFILE
+   * @param type type of the at rule. _AT_AGENT, _AT_PLATFORM, _AT_ACC_PROFILE or _AT_LOCALE
    * @param atRule - the atRule string
    */
   private void _initAtRuleTargetTypes(
@@ -359,6 +373,15 @@ public class SkinCSSDocumentHandler
         
         _selectorPlatforms = _getIntArray(list);
       }
+      else if (_AT_LOCALE.equals(type))
+      {
+        _locales = new HashSet<Locale>();
+        for (int i = 0; i < typeArray.length; i++)
+        {
+          Locale locale = LocaleUtils.getLocaleForIANAString(typeArray[i].replace('_', '-').trim());
+          _locales.add(locale);
+        }
+      }
       else if (_AT_ACC_PROFILE.equals(type))
       {
         // The number of profile properties is always going to be
@@ -501,6 +524,7 @@ public class SkinCSSDocumentHandler
     public CompleteSelectorNode(
       String                     selectorName,
       List<PropertyNode>         propertyNodes,
+      Set<Locale>                locales,            
       int                        direction,
       AgentAtRuleMatcher         agentMatcher,
       int[]                      platforms,
@@ -514,6 +538,8 @@ public class SkinCSSDocumentHandler
       // at the end of the @rule parsing.
       _agentMatcher = agentMatcher;
       _platforms = _copyIntArray(platforms);
+      _locales = ((locales != null) ? new HashSet<Locale>(locales)
+            :Collections.<Locale>emptySet());
       
       if (accProperties != null)
       {
@@ -551,6 +577,11 @@ public class SkinCSSDocumentHandler
       return _platforms;
     }
 
+    public Set<Locale> getLocales()
+    {
+      return _locales;
+    }
+
     public Set<String> getAccessibilityProperties()
     {
       return _accProperties;
@@ -572,12 +603,14 @@ public class SkinCSSDocumentHandler
     private final int _direction;  // the reading direction
     private final AgentAtRuleMatcher _agentMatcher;
     private final int[] _platforms;
+    private final Set<Locale> _locales; 
     private final Set<String> _accProperties;
   }
 
-  private static String _AT_AGENT = "@agent";
-  private static String _AT_PLATFORM = "@platform";
-  private static String _AT_ACC_PROFILE = "@accessibility-profile";
+  private static final String _AT_AGENT = "@agent";
+  private static final String _AT_PLATFORM = "@platform";
+  private static final String _AT_LOCALE = "@locale";
+  private static final String _AT_ACC_PROFILE = "@accessibility-profile";
 
   // below are properties that we set and reset
   // as the methods of this documentHandler get called.
@@ -594,6 +627,9 @@ public class SkinCSSDocumentHandler
   // matches the current Agent against the allowed agents
   private AgentAtRuleMatcher _agentAtRuleMatcher = null;
 
+  // the locales of the selectors parsed in this document.
+  private Set<Locale> _locales = null;
+
   // Stack of accessibility property sets.  While java.util.Stack has the
   // push/pop API that we want, we don't need the synchronization, so we
   // just use a LinkedList instead and pretend its a stack.
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetNode.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetNode.java
index c0841bf..e857b9f 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetNode.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetNode.java
@@ -21,6 +21,7 @@ package org.apache.myfaces.trinidadinternal.skin;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -41,11 +42,13 @@ class SkinStyleSheetNode
     List<SkinSelectorPropertiesNode> skinSelectorNodeList,
     Map<String, String>              namespaceMap,
     int                              direction,
+    Set<Locale>                      locales,
     AgentAtRuleMatcher               agentMatcher,
     Set<String>                      accProperties)
   {
     _skinSelectorNodeList = skinSelectorNodeList;
     _namespaceMap = namespaceMap;
+    _locales = locales;
     _direction = direction;
     _agentMatcher = agentMatcher;
     _platforms     = null;
@@ -55,12 +58,14 @@ class SkinStyleSheetNode
   SkinStyleSheetNode(
     Map<String, String>        namespaceMap,
     int                        direction,
+    Set<Locale>                locales,
     AgentAtRuleMatcher         agentMatcher,
     int[]                      platforms,
     Set<String>                accProperties)
   {
     _namespaceMap = namespaceMap;
     _direction = direction;
+    _locales = locales;
     _agentMatcher = agentMatcher;
     _platforms = platforms;
     _accProperties = accProperties;
@@ -113,6 +118,11 @@ class SkinStyleSheetNode
     return _platforms;
   }
 
+  public Set<Locale> getLocales()
+  {
+    return _locales;
+  }
+
   public Set<String> getAcessibilityProperties()
   {
     return _accProperties;
@@ -122,6 +132,7 @@ class SkinStyleSheetNode
     int                        direction,
     AgentAtRuleMatcher         agentMatcher,
     int[]                      platforms,
+    Set<Locale>                locales,
     Set<String>                accProperties)
   {
     if (direction == _direction)
@@ -133,10 +144,13 @@ class SkinStyleSheetNode
         boolean platformsMatch = _intArraysEqual(platforms, _platforms);
         if (platformsMatch)
         {
-          boolean accMatch = _setsEqual(accProperties, _accProperties);
-
-          if (accMatch)
-            return true;
+          boolean localeMatch = _setsEqual(locales, _locales);
+          if (localeMatch)
+          {
+            boolean accMatch = _setsEqual(accProperties, _accProperties);
+            if (accMatch)
+             return true;
+          }
         }
       }
     }
@@ -167,5 +181,6 @@ class SkinStyleSheetNode
   private final int _direction; // reading direction
   private final AgentAtRuleMatcher _agentMatcher;
   private final int[] _platforms;
+  private final Set<Locale> _locales;
   private final Set<String> _accProperties;
 }
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
index f921f12..9cc6217 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
@@ -266,7 +266,7 @@ class SkinStyleSheetParserUtils
           new StyleSheetNode(styleNodeArray,
                              iconNodeList,
                              trSkinPropertyNodeList,
-                             null,/*locales, not yet supported*/
+                             skinSSNode.getLocales(),
                              skinSSNode.getDirection(),
                              skinSSNode.getAgentMatcher(),
                              skinSSNode.getPlatforms(),
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
index c27faba..73931bb 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
@@ -57,7 +57,7 @@ public class StyleSheetNode
     StyleNode[] styles,
     Collection<IconNode> icons,
     Collection<SkinPropertyNode> skinProperties,
-    Locale[] locales,
+    Set<Locale> locales,
     int direction,
     AgentAtRuleMatcher agentMatcher,
     int[] platforms,
@@ -86,8 +86,7 @@ public class StyleSheetNode
     // locales, browsers, versions, platforms order does not matter, so these are Sets.
     if (locales != null)
     {
-      Set<Locale> localesSet = _copyLocaleArrayToSet(locales);
-      _locales = Collections.unmodifiableSet(localesSet);
+      _locales = Collections.unmodifiableSet(locales);
     }
     else
       _locales = Collections.emptySet();
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
index 0645c50..681a18c 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
@@ -41,6 +41,7 @@ import org.apache.myfaces.trinidadinternal.skin.AgentAtRuleMatcher;
 import org.apache.myfaces.trinidadinternal.style.StyleConstants;
 import org.apache.myfaces.trinidadinternal.style.util.NameUtils;
 import org.apache.myfaces.trinidadinternal.style.xml.XMLConstants;
+import org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXParseException;
 
@@ -142,23 +143,6 @@ public class StyleSheetNodeParser extends BaseNodeParser
     }
   }
 
-  // Converts a string to a locale
-  private Locale _getLocale(String str)
-  {
-    // Language only
-    int length = str.length();
-    if (length == 2)
-      return new Locale(str, "");
-
-    // Locale and country
-    if ((length == 5) && (str.charAt(2) == '_'))
-      return new Locale(str.substring(0, 2), str.substring(3, 5));
-
-    // We don't handle variants at the moment...
-
-    return null;
-  }
-
   // Initialize locales
   private void _initLocales(String localeAttr)
   {
@@ -167,20 +151,16 @@ public class StyleSheetNodeParser extends BaseNodeParser
 
     // -= Simon Lessard =-
     // TODO: Check if synchronization is really needed.
-    Vector<Locale> locales = new Vector<Locale>();
+    _locales = Collections.synchronizedSet(new HashSet<Locale>());
     Iterator<String> tokens = _getTokens(localeAttr);
     while (tokens.hasNext())
     {
-      Locale locale = _getLocale(tokens.next());
+      String localeString = tokens.next();
+      // TODO: check if the replace of _ with - is really necessary. Also see RequestContextImpl.getFormattingLocale()
+      Locale locale = LocaleUtils.getLocaleForIANAString(localeString.replace('_', '-').trim());
 
       if (locale != null)
-        locales.addElement(locale);
-    }
-
-    if (locales != null)
-    {
-      _locales = new Locale[locales.size()];
-      locales.copyInto(_locales);
+        _locales.add(locale);
     }
   }
 
@@ -309,7 +289,7 @@ public class StyleSheetNodeParser extends BaseNodeParser
   // -= Simon Lessard =-
   // TODO: Check if synchronization is really needed.
   private Vector<StyleNode> _styles;
-  private Locale[]          _locales;
+  private Set<Locale>       _locales;
   private int               _direction;
   private int               _mode;
   private List<TrinidadAgent.Application> _browsers;
diff --git a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeEqualsTest.java b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeEqualsTest.java
index f4a0594..55240e4 100644
--- a/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeEqualsTest.java
+++ b/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeEqualsTest.java
@@ -129,9 +129,8 @@ public class StyleSheetNodeEqualsTest extends TestCase
     List<IconNode> anotherIconNodes = _getIconNodes();
 
     // create locales arrays
-    Locale[] localesArray = getLocalesArray();
-    Locale[] anotherLocalesArray = getAnotherLocalesArray();
-    Locale[] diffOrderLocalesArray = getDiffOrderLocalesArray();
+    Set<Locale> localeSet = getLocalesSet();
+    Set<Locale> diffOrderLocalesSet = getDiffOrderLocalesSet();
      
     // create a browsers map
     String browserSelector = "netscape and (version:5), netscape and (version:6), ie and (version:7), ie and (version:8)";
@@ -159,7 +158,7 @@ public class StyleSheetNodeEqualsTest extends TestCase
       new StyleSheetNode(styleSheetOneNodes,
                          iconNodes,
                          null,
-                         localesArray,
+                         localeSet,
                          0,
                          new AgentAtRuleMatcher(browserSelector),
                          platforms,
@@ -169,7 +168,7 @@ public class StyleSheetNodeEqualsTest extends TestCase
       new StyleSheetNode(anotherStyleSheetOneNodes,
                          anotherIconNodes,
                          null,
-                         anotherLocalesArray,
+                         localeSet,
                          0,
                          new AgentAtRuleMatcher(anotherBrowserSelector),
                          anotherPlatforms,
@@ -179,7 +178,7 @@ public class StyleSheetNodeEqualsTest extends TestCase
       new StyleSheetNode(anotherStyleSheetOneNodes,
                          anotherIconNodes,
                          null,
-                         diffOrderLocalesArray,
+                         diffOrderLocalesSet,
                          0,
                          new AgentAtRuleMatcher(anotherBrowserDiffOrder),
                          differentOrderPlatforms,
@@ -203,7 +202,7 @@ public class StyleSheetNodeEqualsTest extends TestCase
 
     // these should be false
     assertEquals(styleSheetNode.equals(null), false);
-    assertEquals(styleSheetNode.equals(localesArray), false);
+    assertEquals(styleSheetNode.equals(localeSet), false);
     
     /* Test styleSheetNode's toString */
     /*

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 21/36: TRINIDAD-1728 - Trinidad not supporting Opera Mobile in HTC

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 1c84421970dbbd00fd1831b1068bb2f9d55831a9
Author: Mamallan Uthaman <mu...@apache.org>
AuthorDate: Wed Feb 24 19:08:45 2010 +0000

    TRINIDAD-1728 - Trinidad not supporting Opera Mobile in HTC
---
 .../apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java  | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
index fcf95a5..7c70243 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/agent/AgentFactoryImpl.java
@@ -709,6 +709,15 @@ public class AgentFactoryImpl implements AgentFactory
 
       int operaIndex = agent.indexOf("Opera/");
       int firstSpace = agent.indexOf(" ");
+            
+      // Opera Mobile running in HTC
+      if (agent.indexOf("HTC-") != -1 || 
+          agent.indexOf("HTC_") != -1 || 
+          agent.indexOf("XV6850") != -1)
+      {
+        firstSpace = agent.indexOf(" ", operaIndex);
+      }
+      
       if (operaIndex >= 0 && firstSpace >=0 )
       {
         agentObj.setAgentVersion(agent.substring(operaIndex + 6,firstSpace));

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 13/36: TRINIDAD-1702 performance: decrease memory of FileSystemStyleCache by reusing CSSStyle objects.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 648e79553e257cd09adcfa27d68bf80658fa91b0
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Tue Feb 2 18:22:55 2010 +0000

    TRINIDAD-1702 performance: decrease memory of FileSystemStyleCache by reusing CSSStyle objects.
---
 .../style/cache/FileSystemStyleCache.java          | 61 +++++++++++++++++++++-
 1 file changed, 60 insertions(+), 1 deletion(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
index 518ea8d..0c17937 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/cache/FileSystemStyleCache.java
@@ -1426,8 +1426,66 @@ public class FileSystemStyleCache implements StyleProvider
         if (name != null && value != null)
           styleProperties.put(name, value);
       }
+      
+      // To save memory, we reuse CSSStyle objects if 
+      // they have the same list of style property names and values.
+      // StyleKey is the key into the StyleKey, CSSStyle map.
+      StyleKey key = new StyleKey(styleProperties);
+      Style cachedStyle = _styleNodeToStyleMap.get(key);
+      if (cachedStyle == null)
+      {
+        // no match is cached yet, so create a new CSSStyle and cache in the map.
+        Style style = new CSSStyle(styleProperties);
+        _styleNodeToStyleMap.put(key, style);
+        return style;         
+      }
+      else
+      {
+        return cachedStyle;
+      }
+    }
+    
+    /**
+     * A StyleKey object is used as a key into a map so that we can share CSSStyle objects
+     * if they are equal and they have the same hashCode.
+     */
+    private static class StyleKey
+    {
+      public StyleKey(Map<String, String> styleProperties)
+      {
+        _styleProperties = styleProperties;
+      }
+      
+      @Override
+      public int hashCode()
+      {
+        int hash = 17;
+        // take each style property name and value and create a hashCode from it.
+        for (Map.Entry<String, String> e : _styleProperties.entrySet())
+        {
+          String name = e.getKey();
+          hash = 37*hash + ((null == name) ? 0 : name.hashCode());
+
+          String value = e.getValue();
+          hash = 37*hash + ((null == value) ? 0 : value.hashCode());
 
-      return new CSSStyle(styleProperties);
+        }
+        return hash;
+      }
+      @Override  
+      public boolean equals(Object obj)
+      {
+        if (this == obj)
+          return true;
+        if (!(obj instanceof StyleKey))
+          return false;
+          
+        // obj at this point must be a StyleKey
+        StyleKey test = (StyleKey)obj;
+        return test._styleProperties.equals(this._styleProperties);
+      }
+      
+      Map<String, String> _styleProperties;
 
     }
 
@@ -1436,6 +1494,7 @@ public class FileSystemStyleCache implements StyleProvider
     private final String[]             _namespacePrefixArray;
     private final Map<String, String>  _shortStyleClassMap;
     private final boolean              _compress;
+    private Map<StyleKey, Style> _styleNodeToStyleMap = new ConcurrentHashMap<StyleKey, Style>();
   }
 
   private class StyleWriterFactoryImpl

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 04/36: code cleanup commented skinning code SkinStyleSheetParserUtils.java - static public StyleSheetEntry parseCSSSource (returns StyleSheetEntry instead of Object) StyleSheetNode - use contains on Set before looping of locale matching

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 193c48d9c9e0e231eefb668b4568bb355117cfaf
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Thu Jan 7 01:46:24 2010 +0000

    code cleanup
    commented skinning code
    SkinStyleSheetParserUtils.java - static public StyleSheetEntry parseCSSSource (returns StyleSheetEntry instead of Object)
    StyleSheetNode - use contains on Set before looping of locale matching
---
 .../myfaces/trinidadinternal/share/xml/XMLUtils.java   |  2 +-
 .../skin/SkinStyleSheetParserUtils.java                |  9 ++++++---
 .../myfaces/trinidadinternal/skin/StyleSheetEntry.java | 18 +++++++++++-------
 .../style/xml/StyleSheetDocumentUtils.java             |  6 +++---
 .../style/xml/parse/IncludePropertyNodeParser.java     |  2 +-
 .../style/xml/parse/PropertyNodeParser.java            |  2 +-
 .../style/xml/parse/SkinPropertyNode.java              |  1 +
 .../style/xml/parse/StyleNodeParser.java               |  2 +-
 .../style/xml/parse/StyleSheetDocumentParser.java      |  2 +-
 .../style/xml/parse/StyleSheetNode.java                | 11 +++++++++--
 .../style/xml/parse/StyleSheetNodeParser.java          |  3 ++-
 11 files changed, 37 insertions(+), 21 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
index 1acafb8..e2a29af 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/xml/XMLUtils.java
@@ -51,7 +51,7 @@ import org.apache.myfaces.trinidadinternal.share.expl.JavaMethod;
 public class XMLUtils
 {
   /**
-   * Parses an XML file.  For includes, see parseInclude().
+   * Parses an XML file, like the skinning .xss file.  For includes, see parseInclude().
    * @param context the current ParseContext, which will be cloned
    * @param xmlProvider an XML provider
    * @param manager a ParserManager
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
index 9cc6217..9751e15 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/SkinStyleSheetParserUtils.java
@@ -60,6 +60,9 @@ import org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils;
 
 
 /**
+ * Utility class for creating a StyleSheetDocument.
+ * The main method is parseCSSSource which creates a StyleSheetEntry.
+ * The interim object is SkinStyleSheetNode
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/skin/SkinStyleSheetParserUtils.java#0 $) $Date: 10-nov-2005.18:59:00 $
  */
 class SkinStyleSheetParserUtils
@@ -72,7 +75,7 @@ class SkinStyleSheetParserUtils
    * @param sourceName the name of the target, relative to the current file
    * @param expectedType the expected Java type of the target.
    */
-  static public Object parseCSSSource(
+  static public StyleSheetEntry parseCSSSource(
     ParseContext  context,
     NameResolver  resolver,
     String        sourceName,
@@ -91,7 +94,7 @@ class SkinStyleSheetParserUtils
     InputStreamProvider provider = resolver.getProvider(sourceName);
     Object cached = provider.getCachedResult();
     if ((cached != null) && expectedType.isInstance(cached))
-      return cached;
+      return (StyleSheetEntry)cached;
 
     InputStream stream = provider.openInputStream();
 
@@ -159,7 +162,7 @@ class SkinStyleSheetParserUtils
    * A StyleSheetEntry is an object that contains:
    * styleSheetName, StyleSheetDocument
    * A StyleSheetDocument contains StyleSheetNodes. A StyleSheetNode contains
-   * a list css style selectors and their properties and additional info like
+   * a list style selectors and their properties and additional info like
    * the direction, locale, etc. for this list of selectors.
    * @param context
    * @param sourceName
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
index 6c9cee3..acd0291 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/skin/StyleSheetEntry.java
@@ -37,7 +37,10 @@ import org.apache.myfaces.trinidadinternal.style.xml.parse.StyleSheetDocument;
 
 /**
  * Package-private utility class used by Skin implementation
- * to manage a single XSS or CSS skin stylesheet source file.
+ * to manage a single XSS or CSS skin stylesheet source file .
+ * This class calls the parsing code which parses either the XSS or CSS file (_createSkinStyleSheet),
+ * and it stores a StyleSheetDocument object, which is a parsed representation of a 
+ * Trinidad style sheet document whether that is in the css or xss format or merged.
  * This class could actually
  * be pushed into an inner class in Skin, but at the moment
  * it is separated out simply to reduce the amount of code in
@@ -48,7 +51,7 @@ import org.apache.myfaces.trinidadinternal.style.xml.parse.StyleSheetDocument;
 class StyleSheetEntry
 {
   /**
-   * Creates a StyleSheetEntry for the specified context/name.
+   * Creates a StyleSheetEntry for the specified context and styleSheetName.
    * This method will log any errors/exceptions and return
    * null if the style sheet source file could not be found/parsed.
    */
@@ -164,7 +167,7 @@ class StyleSheetEntry
     {
 
       // Parse the style sheet to create the StyleSheetDocument
-      StyleSheetDocument document = _createStyleSheetDocument(resolver,
+      StyleSheetDocument document = _createStyleSheetDocumentFromXSS(resolver,
                                                               styleSheetName);
       if (document == null)
         skinStyleSheet = null;
@@ -189,7 +192,7 @@ class StyleSheetEntry
   }
 
 
-  // Creates the StyleSheetEntry
+  // Creates the StyleSheetEntry from a skinning file that ends in .css
   private static StyleSheetEntry _createSkinStyleSheetFromCSS(
     NameResolver     resolver,
     String           styleSheetName
@@ -201,7 +204,7 @@ class StyleSheetEntry
         ParseContextImpl parseContext = new ParseContextImpl();
         // if this is a utility that isn't in this file, then I can't return a SkinStyleSheet.
         // I think instead this parseCSSSource should return a new instance of StyleSheetEntry.
-        return (StyleSheetEntry)SkinStyleSheetParserUtils.parseCSSSource(
+        return SkinStyleSheetParserUtils.parseCSSSource(
                                     parseContext,
                                     resolver,
                                     styleSheetName,
@@ -217,8 +220,8 @@ class StyleSheetEntry
       return null;
   }
 
-  // Creates the StyleSheetDocument
-  private static StyleSheetDocument _createStyleSheetDocument(
+  // Creates the StyleSheetDocument from a skinning file that ends in .xss, like base-desktop.xss
+  private static StyleSheetDocument _createStyleSheetDocumentFromXSS(
     NameResolver     resolver,
     String           styleSheetName
     )
@@ -228,6 +231,7 @@ class StyleSheetEntry
 
     try
     {
+      // this will parse the xss file adn return a StyleSheetDocument
       return StyleSheetDocumentUtils.createStyleSheetDocument(xmlProvider,
                                                               resolver,
                                                               styleSheetName);
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
index 3413d56..c59f6ec 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/StyleSheetDocumentUtils.java
@@ -49,14 +49,14 @@ import org.apache.myfaces.trinidadinternal.style.xml.parse.StyleSheetNode;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 
 /**
- * Utility class for parsing an XSS document into a StyleSheetDocument.
+ * Utility class for creating  a StyleSheetDocument.
  *
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/StyleSheetDocumentUtils.java#0 $) $Date: 10-nov-2005.18:58:00 $
  */
 public class StyleSheetDocumentUtils
 {
   /**
-   * Creates a StyleSheetDocument from the specified InputSource
+   * Creates a StyleSheetDocument from the specified InputSource (.xss file)
    *
    * @param provider The XMLProvider to use to parse the source document
    * @param source The InputSource for the source document.  The system
@@ -84,7 +84,7 @@ public class StyleSheetDocumentUtils
   }
 
   /**
-   * Creates a StyleSheetDocument from the specified InputSource
+   * Creates a StyleSheetDocument from the specified InputSource (.xss file)
    * @param xmlProvider The XMLProvider to use to parse the source document
    * @param resolver The NameResolver to use to locate the source document.
    *                 This must be a non-null instance.
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java
index 7949196..245e699 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/IncludePropertyNodeParser.java
@@ -30,7 +30,7 @@ import org.apache.myfaces.trinidadinternal.style.StyleConstants;
 import org.apache.myfaces.trinidadinternal.style.xml.XMLConstants;
 
 /**
- * NodeParser for includeProperty nodes
+ * NodeParser for includeProperty nodes. This parses the XSS file.
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/IncludePropertyNodeParser.java#0 $) $Date: 10-nov-2005.18:58:08 $
  */
 public class IncludePropertyNodeParser extends LeafNodeParser
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
index ed72c71..debbab5 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
@@ -33,7 +33,7 @@ import org.apache.myfaces.trinidadinternal.style.StyleConstants;
 import org.apache.myfaces.trinidadinternal.style.xml.XMLConstants;
 
 /**
- * NodeParser for property nodes
+ * NodeParser for property nodes. This parses the XSS file.
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/PropertyNodeParser.java#0 $) $Date: 10-nov-2005.18:58:10 $
  */
 public class PropertyNodeParser extends BaseNodeParser
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/SkinPropertyNode.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/SkinPropertyNode.java
index 3b83152..6924566 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/SkinPropertyNode.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/SkinPropertyNode.java
@@ -23,6 +23,7 @@ import org.apache.myfaces.trinidad.logging.TrinidadLogger;
  * A SkinProperyNode is a node that
  * contains the selector, the -tr- property, and the value
  * e.g., af|breadCrumbs, -tr-show-last-item, true
+ * This parses the XSS file.
  *
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/SkinPropertyNode.java#0 $) $Date: 10-nov-2005.18:50:45 $
  */
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
index c886668..02c54a4 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNodeParser.java
@@ -35,7 +35,7 @@ import org.apache.myfaces.trinidadinternal.style.StyleConstants;
 import org.apache.myfaces.trinidadinternal.style.xml.XMLConstants;
 
 /**
- * NodeParser for style nodes
+ * NodeParser for style nodes. This parses the XSS file.
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/StyleNodeParser.java#0 $) $Date: 10-nov-2005.18:58:12 $
  */
 public class StyleNodeParser extends BaseNodeParser
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocumentParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocumentParser.java
index 1a3ff04..f505f1e 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocumentParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocumentParser.java
@@ -47,7 +47,7 @@ import org.apache.myfaces.trinidadinternal.style.StyleConstants;
 import org.apache.myfaces.trinidadinternal.style.xml.XMLConstants;
 
 /**
- * NodeParser for style sheet document nodes
+ * NodeParser for style sheet document nodes. This parses the XSS file.
  *
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/StyleSheetDocumentParser.java#0 $) $Date: 10-nov-2005.18:58:46 $
  */
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
index 2b5dc97..f26ce5a 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNode.java
@@ -41,8 +41,12 @@ import org.apache.myfaces.trinidadinternal.util.nls.LocaleUtils;
  * Private implementation of StyleSheetNode. A StyleSheetNode has StyleNodes for particular
  * browsers, direction, versions, platforms and mode.  In addition, the StyleSheetNode
  * provides access to IconNodes representing the icons which were defined within
- * the context of this style sheet.
- *
+ * the context of this style sheet. StyleSheetNodes are contained in StyleSheetDocuments.
+ * And a StyleSheetNode is created for both .xss skin files and .css files.
+ * .xss skin files create StyleSheetNodes via StyleSheetNodeParser
+ * .css skin files create StyleSheetNodes via SkinStyleSheetParserUtils
+ * @see StyleSheetNodeParser
+ * @see org.apache.myfaces.trinidadinternal.skin.SkinStyleSheetParserUtils
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/StyleSheetNode.java#0 $) $Date: 10-nov-2005.18:58:46 $
  */
 public class StyleSheetNode
@@ -327,6 +331,9 @@ public class StyleSheetNode
       return 0;
 
     int match = 0;
+    
+    if (_locales.contains(locale))
+        return _LOCALE_EXACT_MATCH;
 
     for (Locale tmpLocale : _locales)
     {
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
index c9fa73e..6923905 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java
@@ -45,7 +45,8 @@ import org.xml.sax.SAXParseException;
 
 /**
  * NodeParser for style sheet nodes. This class is thread-safe since it is created each time 
- * with newInstance(). Therefore we do not synchronize
+ * with newInstance(). Therefore we do not synchronize.
+ * This parses the XSS file and creates a StyleSheetNode object.
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/StyleSheetNodeParser.java#0 $) $Date: 10-nov-2005.18:58:47 $
  * @see org.apache.myfaces.trinidadinternal.share.xml.ClassParserFactory#getParser
  */

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 16/36: The first problem we have had is that components need to separate the context setup and teardown needed to process their children from the context setup and tear down of the components themselves. For example, consider a composite component that establishes an EL context for its children--that context should only be setup when the children are being processed, not when the component is processing its own attributes.

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 821819f003a220e41d7b05ffd73fb446bc2699a0
Author: Blake Sullivan <bs...@apache.org>
AuthorDate: Tue Feb 9 18:34:05 2010 +0000

    The first problem we have had is that components need to separate the context setup and teardown needed to process their children from the context setup and tear down of the components themselves.  For example, consider a composite component that establishes an EL context for its children--that context should only be setup when the children are being processed, not when the component is processing its own attributes.
    
    In the case of encoding, we want to delegate to the Renderer to ensure that the setup and teardown of context for child processing is consistent between optimized rendering using tree visiting and full rendering traversals.
    
    The second problem was that UIXComponent.setUpEncodingContext was named differently than all of the other set up methods.  I've made the spelling consistent (which after a quick check of the dictionary is consitently wrong through out Trinidad setup as a compound word is a noun and as a verb is two words, so it should have been setUp.  Drat!) and temporarily left a final deprecated version in that I will whack shortly.
    
    The third issue is that iterating components often want to modify only the manner in which their data is iterated over.  To simplify this, we add a hook visitData() to UIXCollection.
    
    UIXComponent:
    
    /**
     * Hook for subclasses to override the manner in which the component's children are visited.  The default
     * implementation visits all of the children and facets of the Component.
     * <code>setupChildrenVisitingContext</code> will have been called before this method is
     * invoked and <code>tearDownChildrenVisitingContext</code> will be called after.
     * respectively.  If the purpose of this visit was to encode the component and the
     * component uses a CoreRenderer, the CoreRenderer's
     * <code>setupChildrenEncodingContext</code> and <code>tearDownChildrenEncodingContext</code>
     * will be called before and after this method is invoked, respectively.
     * @param visitContext the <code>VisitContext</code> for this visit
     * @param callback the <code>VisitCallback</code> instance
     * @return <code>true</code> if the visit is complete.
     * @see #setupChildrenVisitingContext
     * @see #tearDownChildrenVisitingContext
     * @see org.apache.myfaces.trinidad.render.CoreRenderer#setupChildrenEncodingContext
     * @see org.apache.myfaces.trinidad.render.CoreRenderer#tearDownChildrenEncodingContext
     */
     protected boolean visitChildren(
       VisitContext visitContext,
       VisitCallback callback)
    
     /**
      * <p>Sets up the context necessary to visit or invoke the children of a component for all phases.
      * </p>
      * <p>The default implementation does nothing.</p>
      * <p>If a subclass overrides this method, it should override
      * <code>tearDownChildrenVisitingContext</code> as well.</p>
      * <p>It is guaranteed that if <code>setupChildrenVisitingContext</code> completes
      * <code>tearDownChildrenVisitingContext</code> will be called for this component</p>
      * @param context FacesContext
      * @see #visitChildren
      * @see #tearDownChildrenVisitingContext
      */
     protected void setupChildrenVisitingContext(@SuppressWarnings("unused") FacesContext context)
    
     /**
      * <p>Tears down context created in order to visit or invoke the children of a component
      * for all phases.</p>
      * <p>The default implementation does nothing.</p>
      * <p>A subclass should only override this method if it overrode
      * <code>setupChildrenVisitingContext</code> as well</p>
      * <p>It is guaranteed that <code>tearDownChildrenVisitingContext</code> will be called only after
      * <code>setupChildrenVisitingContext</code> has been called for this component</p>
      * @param context FacesContext
      * @see #setupChildrenVisitingContext
      * @see #visitChildren
      */
     protected void tearDownChildrenVisitingContext(@SuppressWarnings("unused") FacesContext context)
    
    CoreRenderer
    
      * <p>
      * Called before rendering the current component's children in order to set
      * up any special context.
      * </p>
      * <p>If <code>setupChildrenEncodingContext</code> succeeds then
      * <code>tearDownChildrenEncodingContext</code> will be called for the same component.
      * </p>
      * <p>The default implementation does nothing</p>
      * @param context FacesContext for this request
      * @param rc RenderingContext for this encoding pass
      * @param component Component to encode using this Renderer
      * @see #tearDownChildrenEncodingContext
      */
     public void setupChildrenEncodingContext(
       @SuppressWarnings("unused") FacesContext context,
       @SuppressWarnings("unused") RenderingContext rc,
       @SuppressWarnings("unused") UIComponent component)
    
     /**
      * <p>
      * Called after rendering the current component's children in order to tear
      * down any special context.
      * </p>
      * <p>
      * <code>tearDownChildrenEncodingContext</code> will be called on the component if
      * <code>setupChildrenEncodingContext</code> succeeded.
      * </p>
      * <p>The default implementation does nothing</p>
      * @param context FacesContext for this request
      * @param rc RenderingContext for this encoding pass
      * @param component Component to encode using this Renderer
      * @see #setupChildrenEncodingContext
      */
     public void tearDownChildrenEncodingContext(
       @SuppressWarnings("unused") FacesContext context,
       @SuppressWarnings("unused") RenderingContext rc,
       @SuppressWarnings("unused") UIComponent component)
    
    UIXCollection:
    
     /**
      * Visit the rows and children of the columns of the collection per row-index. This should
      * not visit row index -1 (it will be perfomed in the visitTree method). The columns
      * themselves should not be visited, only their children in this function.
      *
      * @param visitContext The visiting context
      * @param callback The visit callback
      * @return true if the visiting should stop
      * @see #visitChildren(VisitContext, VisitCallback)
      */
     protected abstract boolean visitData(
       VisitContext  visitContext,
       VisitCallback callback);
---
 .../trinidad/component/UIXIteratorTemplate.java    | 280 ++++++++++++--
 .../component/UIXNavigationLevelTemplate.java      |  52 ++-
 .../component/UIXNavigationPathTemplate.java       |  74 ++++
 .../component/UIXNavigationTreeTemplate.java       |  42 ++-
 .../trinidad/component/UIXPageTemplate.java        |  87 ++++-
 .../trinidad/component/UIXProcessTemplate.java     |  54 ++-
 .../trinidad/component/UIXTableTemplate.java       |   1 -
 .../trinidad/component/UIXTreeTableTemplate.java   | 112 +++++-
 .../trinidad/component/UIXTreeTemplate.java        |  28 +-
 .../myfaces/trinidad/component/HierarchyUtils.java |  59 +--
 .../myfaces/trinidad/component/StampState.java     |   6 -
 .../myfaces/trinidad/component/TableUtils.java     |   8 +-
 .../myfaces/trinidad/component/UIXCollection.java  | 306 ++++++++++++++--
 .../myfaces/trinidad/component/UIXComponent.java   | 408 ++++++++++++++++-----
 .../trinidad/component/UIXComponentBase.java       |  64 +++-
 .../myfaces/trinidad/component/UIXHierarchy.java   | 106 +++++-
 .../trinidad/component/visit/VisitCallback.java    |   7 +-
 .../trinidad/component/visit/VisitContext.java     |   5 +-
 .../myfaces/trinidad/render/CoreRenderer.java      |  88 +++--
 .../myfaces/trinidad/util/CollectionUtils.java     |   2 -
 .../trinidad/component/UIComponentTestCase.java    |   4 +
 .../myfaces/trinidad/component/UIXProcessTest.java |  16 +
 .../component/core/nav/CoreBreadCrumbsTest.java    |  13 +
 .../trinidadinternal/context/FullVisitContext.java |  10 +-
 .../context/PartialVisitContext.java               |  12 +-
 .../renderkit/core/ppr/PartialPageContextImpl.java |  31 +-
 .../renderkit/core/xhtml/FormRenderer.java         |  19 -
 27 files changed, 1571 insertions(+), 323 deletions(-)

diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXIteratorTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXIteratorTemplate.java
index 7152e2b..85bafad 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXIteratorTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXIteratorTemplate.java
@@ -6,9 +6,9 @@
  *  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
@@ -21,25 +21,34 @@ package org.apache.myfaces.trinidad.component;
 import java.io.IOException;
 
 import java.util.AbstractMap;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
-
 import java.util.Map;
 import java.util.Set;
+
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
 import javax.faces.event.PhaseId;
 
 import javax.faces.render.Renderer;
+
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
 import org.apache.myfaces.trinidad.model.CollectionModel;
 import org.apache.myfaces.trinidad.model.LocalRowKeyIndex;
 import org.apache.myfaces.trinidad.model.ModelUtils;
 
+import org.apache.myfaces.trinidad.render.ClientRowKeyManager;
+
 /**
  * This component iterates over some given data.
  * Each child is repeatedly stamped as many times as necessary.
  * Iteration is done starting at the index given by {@link #getFirst()}
  * for as many indices as specified by {@link #getRows()}.
- * If {@link #getRows()} returns 0, then the iteration continues until 
+ * If {@link #getRows()} returns 0, then the iteration continues until
  * there are no more elements in the underlying data.
  */
 public abstract class UIXIteratorTemplate extends UIXCollection implements FlattenedComponent, LocalRowKeyIndex
@@ -70,7 +79,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
     // Mimic what would normally happen in the non-flattening case for encodeBegin():
     __processFlattenedChildrenBegin();
 
-    Runner runner = new Runner(cpContext)
+    Runner runner = new IndexedRunner(cpContext)
     {
       @Override
       protected void process(UIComponent kid, ComponentProcessingContext cpContext) throws IOException
@@ -79,7 +88,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
       }
     };
     boolean processedChildren = runner.run();
-    Exception exp = runner.exception;
+    Exception exp = runner.getException();
     if (exp != null)
     {
       if (exp instanceof RuntimeException)
@@ -125,7 +134,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
     }
     else // this is not the table. it must be the iterator
     {
-      Runner runner = new Runner()
+      Runner runner = new IndexedRunner()
       {
         @Override
         protected void process(UIComponent kid,
@@ -135,7 +144,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
         }
       };
       runner.run();
-      Exception exp = runner.exception;
+      Exception exp = runner.getException();
       if (exp != null)
       {
         if (exp instanceof RuntimeException)
@@ -167,7 +176,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
       public Object get(Object key)
       {
         // some of these keys are from <c:forEach>, ie:
-        // javax.servlet.jsp.jstl.core.LoopTagStatus 
+        // javax.servlet.jsp.jstl.core.LoopTagStatus
         if ("begin".equals(key)) // from jstl
         {
           return Integer.valueOf(getFirst());
@@ -202,7 +211,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
     CollectionModel current,
     Object value)
   {
-    CollectionModel model = ModelUtils.toCollectionModel(value); 
+    CollectionModel model = ModelUtils.toCollectionModel(value);
     // initialize to -1. we need to do this incase some application logic
     // changed this index. Also, some JSF1.0 RI classes were initially starting
     // with a rowIndex of 0.
@@ -217,7 +226,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
     final FacesContext context,
     final PhaseId phaseId)
   {
-    Runner runner = new Runner()
+    Runner runner = new IndexedRunner()
     {
       @Override
       protected void process(UIComponent kid, ComponentProcessingContext cpContext)
@@ -228,6 +237,109 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
     runner.run();
   }
   
+  // Extract the current row token from the clientId
+  private String _getClientToken(String clientIdPrefix, String cellClientId)
+  {
+    int tokenStartIndex = clientIdPrefix.length() + 1;
+    int tokenEndIndex = cellClientId.indexOf(':', tokenStartIndex);
+    
+    if (tokenEndIndex != -1)
+    {
+      return cellClientId.substring(tokenStartIndex, tokenEndIndex);
+    }
+    else
+    {
+      return null;
+    }
+  }
+  
+  @Override
+  protected boolean visitData(
+    final VisitContext  visitContext,
+    final VisitCallback visitCallback)
+  {
+    Collection<String> subtreeIds = visitContext.getSubtreeIdsToVisit(this);
+ 
+    String ourClientIdPrefix = getClientId(visitContext.getFacesContext());
+   
+    int subtreeIdCount = subtreeIds.size();
+    
+    // build up a set of the row keys to visit rather than iterating
+    // and visiting every row
+    Set<String> rowsToVisit;
+    
+    if (subtreeIdCount > 1)
+    {
+      rowsToVisit = new HashSet<String>(subtreeIdCount);
+
+      for (String currClientId : subtreeIds)
+      {
+        String clientToken = _getClientToken(ourClientIdPrefix, currClientId);
+        
+        if (clientToken != null)
+        {
+          rowsToVisit.add(clientToken);          
+        }
+      }
+    }
+    else
+    {
+      String clientToken = _getClientToken(ourClientIdPrefix,
+                                           subtreeIds.iterator().next());
+      
+      if (clientToken != null)
+      {
+        rowsToVisit = Collections.singleton(clientToken);
+      }
+      else
+      {
+        rowsToVisit = Collections.emptySet();
+      }
+    }
+    
+    // we didn't visit any data
+    if (rowsToVisit.isEmpty())
+      return false;
+    
+    // create a special VisitContext that doesn't visit the Facets
+    // of column components since they aren't visited on each row
+    final VisitContext noColumnFacetContext = new NoColumnFacetsVisitContext(visitContext);
+    
+    // visit only the rows
+    Runner runner = new KeyedRunner(rowsToVisit)
+    {
+      @Override
+      protected void process(
+        UIComponent                kid,
+        ComponentProcessingContext cpContext
+        ) throws IOException
+      {
+        if (kid.getChildCount() > 0)
+        {
+          for (UIComponent grandKid : kid.getChildren())
+          {
+            if (UIXComponent.visitTree(noColumnFacetContext, grandKid, visitCallback))
+            {
+              throw new AbortProcessingException();
+            }
+          }
+        }
+      }
+    };
+
+    try
+    {
+      runner.run();
+    }
+    finally
+    {
+      return (runner.getException() instanceof AbortProcessingException);
+    }
+  }
+
+  /**
+   * Abstract class for processing rows
+   */
   private abstract class Runner implements ComponentProcessor<Object>
   {
     public Runner()
@@ -240,9 +352,79 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
       _cpContext = cpContext;
     }
     
+    public abstract boolean run();
+
+    /**
+     * Sets up the context for the child and processes it
+     */
+    public void processComponent(
+      FacesContext context,
+      ComponentProcessingContext cpContext,
+      UIComponent component,
+      Object callbackContext) throws IOException
+    {
+      try
+      {
+        process(component, cpContext);
+      }
+      catch (IOException ioe)
+      {
+        throw ioe;
+      }
+      catch (AbortProcessingException ape)
+      {
+        // we're done, so abort
+        _exception = ape;        
+        throw ape;
+      }
+      catch (Exception e)
+      {
+        _exception = e;
+      }
+    }
+    
+    public Exception getException()
+    {
+      return _exception;
+    }
+
+    protected abstract void process(UIComponent comp, ComponentProcessingContext cpContext)
+      throws Exception;
+
+    protected final ComponentProcessingContext getComponentProcessingContext()
+    {
+      return _cpContext;
+    }
+
+    public final void setException(Exception e)
+    {
+      _exception = e;
+    }
+    
+    private Exception _exception = null;
+
+    private final ComponentProcessingContext _cpContext;
+  }
+
+  /**
+   * Class for visiting getRows() by index rows starting getFirst()
+   */
+  private abstract class IndexedRunner extends Runner
+  {
+    public IndexedRunner()
+    {
+      this(null);
+    }
+
+    public IndexedRunner(ComponentProcessingContext cpContext)
+    {
+      super(cpContext);
+    }
+    
     public final boolean run()
     {
       FacesContext context = FacesContext.getCurrentInstance();
+      ComponentProcessingContext cpContext = getComponentProcessingContext();
       
       List<UIComponent> stamps = getStamps();
       int oldIndex = getRowIndex();
@@ -262,8 +444,8 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
           if (isRowAvailable())
           {
             // latch processedChild the first time we process a child
-            processedChild |= (_cpContext != null)
-              ? UIXComponent.processFlattenedChildren(context, _cpContext, this, stamps, null)
+            processedChild |= (cpContext != null)
+              ? UIXComponent.processFlattenedChildren(context, cpContext, this, stamps, null)
               : UIXComponent.processFlattenedChildren(context, this, stamps, null);
           }
           else
@@ -272,7 +454,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
       }
       catch (IOException e)
       {
-        exception = e;
+        setException(e);
       }
       finally
       {
@@ -281,38 +463,63 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
       
       return processedChild;
     }
+  }
 
-    /**
-     * Sets up the context for the child and processes it
-     */
-    public void processComponent(
-      FacesContext context,
-      ComponentProcessingContext cpContext,
-      UIComponent component,
-      Object callbackContext) throws IOException
+  /**
+   * Runner that visits the rows specified by the client row key tokens
+   */
+  private abstract class KeyedRunner extends Runner
+  {
+    public KeyedRunner(Iterable<String> clientKeys)
     {
+      super();
+      _clientKeys = clientKeys;
+    }
+    
+    public final boolean run()
+    {
+      FacesContext context = FacesContext.getCurrentInstance();
+     
+      List<UIComponent> stamps = getStamps();
+      int oldIndex = getRowIndex();
+            
+      boolean processedChild = false;
+            
       try
       {
-        process(component, cpContext);
+        // need to convert row key tokens to row keys
+        ClientRowKeyManager rowKeyManager = getClientRowKeyManager();
+
+        for(String clientKey : _clientKeys)
+        {
+          Object rowKey = rowKeyManager.getRowKey(context, UIXIterator.this, clientKey);
+          
+          if (rowKey != null)
+          {
+            setRowKey(rowKey);
+            if (isRowAvailable())
+            {
+              // latch processedChild the first time we process a child
+              processedChild |= UIXComponent.processFlattenedChildren(context, this, stamps, null);
+            }
+          }
+        }
       }
-      catch (IOException ioe)
+      catch (IOException e)
       {
-        throw ioe;
+        setException(e);
       }
-      catch (Exception e)
+      finally
       {
-        exception = e;
+        setRowIndex(oldIndex);
       }
+      
+      return processedChild;
     }
-
-    protected abstract void process(UIComponent comp, ComponentProcessingContext cpContext)
-      throws Exception;
-
-    public Exception exception = null;
-
-    private final ComponentProcessingContext _cpContext;
+    
+    private final Iterable<String> _clientKeys;
   }
-
+  
   @Override
   void __encodeBegin(FacesContext context) throws IOException
   {
@@ -355,7 +562,7 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
           first = 0;
         else
         {
-          // scroll to the last page: 
+          // scroll to the last page:
           first = size - rows;
           model.setRowIndex(first);
           // make sure the row is indeed available:
@@ -375,5 +582,4 @@ public abstract class UIXIteratorTemplate extends UIXCollection implements Flatt
       model.setRowIndex(oldIndex);
     }
   }
-
 }
diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationLevelTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationLevelTemplate.java
index e40e606..08cf59a 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationLevelTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationLevelTemplate.java
@@ -18,9 +18,13 @@
  */
 package org.apache.myfaces.trinidad.component;
 
+import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseId;
 
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
+
 
 /**
  * Base class for the NavigationLevel component.
@@ -39,17 +43,61 @@ abstract public class UIXNavigationLevelTemplate extends UIXNavigationHierarchy
   {
     Object oldPath = getRowKey();
     HierarchyUtils.__setStartDepthPath(this, getLevel());
+    
     // process stamp for one level
     HierarchyUtils.__processLevel(context, phaseId, this);
     setRowKey(oldPath);
 
-
     // process the children
     TableUtils.__processChildren(context, this, phaseId);
   }
 
+  @Override
+  protected boolean visitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    boolean done = visitData(visitContext, callback);
 
+    if (!done)
+    {
+      // process the children
+      int childCount = getChildCount();
+      if (childCount > 0)
+      {
+        for (UIComponent child : getChildren())
+        {
+          done = UIXComponent.visitTree(visitContext, child, callback);
+          
+          if (done)
+            break;
+        }
+      }          
+    }
+    
+    return done;
+  }
+  
+  @Override
+  protected boolean visitData(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    Object oldKey = getRowKey();
+       
+    boolean done;
 
+    HierarchyUtils.__setStartDepthPath(this, getLevel());
 
-
+    try
+    {
+      done = visitLevel(visitContext, callback, getStamps());
+    }
+    finally
+    {
+      setRowKey(oldKey);
+    }
+    
+    return done;
+  }
 }
diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationPathTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationPathTemplate.java
index 10c7d23..f2e7d71 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationPathTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationPathTemplate.java
@@ -25,6 +25,9 @@ import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseId;
 
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
+
 
 /**
  * Base class for the NavigationPath component.
@@ -68,5 +71,76 @@ abstract public class UIXNavigationPathTemplate extends UIXNavigationHierarchy
     TableUtils.__processChildren(context, this, phaseId);
   }  
 
+  @Override
+  protected boolean visitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    boolean done = visitData(visitContext, callback);
+    
+    if (!done)
+    {
+      // process the children
+      int childCount = getChildCount();
+      if (childCount > 0)
+      {
+        for (UIComponent child : getChildren())
+        {
+          done = UIXComponent.visitTree(visitContext, child, callback);
+          
+          if (done)
+            break;
+        }
+      }          
+    }
+    
+    return done;
+  }
+  
+  @Override
+  protected boolean visitData(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    Object focusPath = getFocusRowKey();
+    Object oldRowKey = null;
+    
+    boolean done = false;
+    
+    // start from the focused area
+    if (focusPath != null)
+    {
+      List<UIComponent> stamps = getStamps();
+      
+      if (!stamps.isEmpty())
+      {
+        List<Object> paths =  new ArrayList<Object>(getAllAncestorContainerRowKeys(focusPath));
+        paths.add(focusPath);
+        
+        int focusPathSize = paths.size();
+        
+        try
+        {
+          for (int i = 0; i < focusPathSize && !done; i++)
+          {
+            setRowKey(paths.get(i));
+            
+            for (UIComponent stamp : stamps)
+            {
+              done = UIXComponent.visitTree(visitContext, stamp, callback);
+              
+              if (done)
+                break;
+            }
+          }
+        }
+        finally
+        {
+          setRowKey(oldRowKey);
+        }
+      }
+    }
     
+    return done;
+  } 
 }
diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationTreeTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationTreeTemplate.java
index daaf0b8..37da902 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationTreeTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXNavigationTreeTemplate.java
@@ -29,6 +29,9 @@ import javax.faces.event.PhaseId;
 
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
+import org.apache.myfaces.trinidad.component.visit.VisitHint;
 import org.apache.myfaces.trinidad.model.CollectionModel;
 import org.apache.myfaces.trinidad.model.RowKeySet;
 import org.apache.myfaces.trinidad.model.RowKeySetTreeImpl;
@@ -93,7 +96,7 @@ abstract public class UIXNavigationTreeTemplate extends UIXNavigationHierarchy
     // this component has no facets that need to be processed once.
     // instead process the "nodeStamp" facet as many times as necessary:
     Object oldPath = getRowKey();
-    HierarchyUtils.__setStartLevelPath(this, getStartLevel());
+    HierarchyUtils.__setStartDepthPath(this, getStartLevel());
     HierarchyUtils.__iterateOverTree(context,
                                       phaseId,
                                       this,
@@ -103,6 +106,43 @@ abstract public class UIXNavigationTreeTemplate extends UIXNavigationHierarchy
   }
 
   @Override
+  protected boolean visitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    return visitData(visitContext, callback);
+  }
+  
+  @Override
+  protected boolean visitData(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    Object oldRowKey = getRowKey();
+
+    // if we are only visiting rendered stamps, then pass in the disclosed row keys, otherwise
+    // pass in null, indicating that all row keys should be visited
+    RowKeySet disclosedRowKeys = (visitContext.getHints().contains(VisitHint.SKIP_UNRENDERED))
+                                   ? getDisclosedRowKeys()
+                                   : null;
+    
+    boolean done;
+
+    HierarchyUtils.__setStartDepthPath(this, getStartLevel());
+
+    try
+    {
+      done = visitHierarchy(visitContext, callback, getStamps(), disclosedRowKeys);
+    }
+    finally
+    {
+      setRowKey(oldRowKey);
+    }
+    
+    return done;
+  }
+  
+  @Override
   void __encodeBegin(FacesContext context) throws IOException
   {
     HierarchyUtils.__handleEncodeBegin(this, getDisclosedRowKeys());
diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java
index fc79abf..71920e5 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXPageTemplate.java
@@ -25,13 +25,15 @@ import java.util.Map;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
 import javax.faces.event.AbortProcessingException;
 import javax.faces.event.FacesEvent;
 import javax.faces.event.PhaseId;
 
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
+import org.apache.myfaces.trinidad.component.visit.VisitHint;
 import org.apache.myfaces.trinidad.model.CollectionModel;
 import org.apache.myfaces.trinidad.model.RowKeySet;
 import org.apache.myfaces.trinidad.model.RowKeySetTreeImpl;
@@ -115,7 +117,90 @@ abstract public class UIXPageTemplate extends UIXMenuHierarchy
         processComponent(context, facets.get(facetKey), phaseId);
       }
     }
+  }
+  
+  @Override
+  protected boolean visitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    boolean done = visitData(visitContext, callback);
+    
+    if (!done)
+    {
+      // process the children
+      int childCount = getChildCount();
+      if (childCount > 0)
+      {
+        for (UIComponent child : getChildren())
+        {
+          done = UIXComponent.visitTree(visitContext, child, callback);
+          
+          if (done)
+            break;
+        }
+      }
+      
+      // process the non-stamp facet children
+      if (!done)
+      {
+        // Visit the facets except for the node stamp
+        int facetCount = getFacetCount();
+        
+        if (facetCount > 0)
+        {
+          UIComponent nodeStamp = getNodeStamp();
+          
+          // if our only facet is the node stamp, we don't need to do this
+          if ((facetCount > 1) || (nodeStamp == null))
+          {
+            for (UIComponent facet : getFacets().values())
+            {
+              // ignore the nodeStamp facet, since it is stamped
+              if (facet != nodeStamp)
+              {
+                if (UIXComponent.visitTree(visitContext, facet, callback))
+                {
+                  done = true;
+                  break;
+                }
+              }
+            }
+          }
+        }        
+      }
+    }
+    
+    return done;
+  }
+  
+  @Override
+  protected boolean visitData(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    Object oldPath = getRowKey();
+
+    // if we are only visiting rendered stamps, then pass in the disclosed row keys, otherwise
+    // pass in null, indicating that all row keys should be visited
+    RowKeySet disclosedRowKeys = (visitContext.getHints().contains(VisitHint.SKIP_UNRENDERED))
+                                   ? getDisclosedRowKeys()
+                                   : null;
 
+    setRowKey(null);
+
+    boolean done;
+    
+    try
+    {
+      done = visitHierarchy(visitContext, callback, getStamps(), disclosedRowKeys);
+    }
+    finally
+    {
+      setRowKey(oldPath);
+    }
+    
+    return done;
   }
 
   @Override
diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXProcessTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXProcessTemplate.java
index 0169371..91dd258 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXProcessTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXProcessTemplate.java
@@ -18,9 +18,13 @@
  */
 package org.apache.myfaces.trinidad.component;
 
+import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseId;
 
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
+
 
 /**
  * Base class for the Process component, which shows the steps of a process.
@@ -44,9 +48,55 @@ abstract public class UIXProcessTemplate extends UIXMenuHierarchy
     
     // process the children
     TableUtils.__processChildren(context, this, phaseId);
-    
   }  
 
+  @Override
+  protected boolean visitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    boolean done = visitData(visitContext, callback);
+    
+    if (!done)
+    {
+      // process the children
+      int childCount = getChildCount();
+      if (childCount > 0)
+      {
+        for (UIComponent child : getChildren())
+        {
+          done = UIXComponent.visitTree(visitContext, child, callback);
+          
+          if (done)
+            break;
+        }
+      }          
+    }
+    
+    return done;
+  }
   
-  
+  @Override
+  protected boolean visitData(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    Object oldKey = getRowKey();
+       
+    Object focusPath = getFocusRowKey();    
+    setRowKey(focusPath);  
+    
+    boolean done;
+
+    try
+    {
+      done = visitLevel(visitContext, callback, getStamps());
+    }
+    finally
+    {
+      setRowKey(oldKey);
+    }
+        
+    return done;
+  }
 }
diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
index e2f09ec..2b286aa 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTableTemplate.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 
 import javax.el.MethodExpression;
 
diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java
index b7ff644..31c9f6a 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java
@@ -36,11 +36,12 @@ import javax.faces.event.AbortProcessingException;
 import javax.faces.event.FacesEvent;
 import javax.faces.event.PhaseId;
 
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
 import org.apache.myfaces.trinidad.event.FocusEvent;
 import org.apache.myfaces.trinidad.event.RangeChangeEvent;
 import org.apache.myfaces.trinidad.event.RangeChangeListener;
 import org.apache.myfaces.trinidad.model.RowKeySet;
-import org.apache.myfaces.trinidad.model.TreeModel;
 
 /**
  * Base class for TreeTable component. The behaviours implemented by the
@@ -274,19 +275,36 @@ abstract public class UIXTreeTableTemplate extends UIXTree
    */
   // TODO cache the result.
   @Override
-  @SuppressWarnings("unchecked")
-  protected final List getStamps()
+  protected final List<UIComponent> getStamps()
   {
+    
     List<UIComponent> children = getChildren();
-    UIComponent nodeStamp = getNodeStamp();
-    if (nodeStamp != null)
+    List<UIComponent> stamps;
+    
+    if (children.isEmpty())
+    {
+      // no children, so use Node stamps as the stamp
+      stamps = super.getStamps();
+    }
+    else
     {
-      List<UIComponent> stamps = new ArrayList<UIComponent>(children.size() + 1);
-      stamps.addAll(children);
-      stamps.add(nodeStamp);
-      return stamps;
+      UIComponent nodeStamp = getNodeStamp();
+      
+      if (nodeStamp == null)
+      {
+        // no node stamp, so stamp, is only the children
+        stamps = children;
+      }
+      else
+      {
+        // stamps are the children plus the node stamp
+        stamps = new ArrayList<UIComponent>(children.size() + 1);
+        stamps.addAll(children);
+        stamps.add(nodeStamp);
+      }
     }
-    return children;
+    
+    return stamps;
   }
 
   /**
@@ -383,6 +401,80 @@ abstract public class UIXTreeTableTemplate extends UIXTree
     }
   }
 
+  @Override
+  protected boolean visitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    // need to override to do the default since our superclass
+    // UIXTree does stuff here we don't want
+    return defaultVisitChildren(visitContext, callback);
+  }
+
+  @Override
+  protected boolean visitUnstampedFacets(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    // Visit the facets except for the node stamp
+    int facetCount = getFacetCount();
+    
+    if (facetCount > 0)
+    {
+      UIComponent nodeStamp = getNodeStamp();
+      
+      // if our only facet is the node stamp, we don't need to do this
+      if ((facetCount > 1) || (nodeStamp == null))
+      {
+        for (UIComponent facet : getFacets().values())
+        {
+          // ignore the nodeStamp facet, since it is stamped
+          if (facet != nodeStamp)
+          {
+            if (UIXComponent.visitTree(visitContext, facet, callback))
+            {
+              return true;
+            }
+          }
+        }
+      }
+    }
+
+    return false;
+  }
+
+  @Override
+  protected boolean visitData(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    Object focusedPath = getFocusRowKey();
+    Object oldRowKey = null;
+    
+    // start from the focused area
+    if (focusedPath != null)
+    {
+      oldRowKey = getRowKey();
+      setRowKey(focusedPath);
+    }
+    
+    boolean done;
+    
+    try
+    {
+      done = super.visitData(new NoColumnFacetsVisitContext(visitContext), callback);
+    }
+    finally
+    {
+      if (focusedPath != null)
+      {
+        setRowKey(oldRowKey);
+      }
+    }
+    
+    return done;
+  }
+
   /**
    * Gets the path of the parent
    */
diff --git a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
index 928c06d..099c1db 100644
--- a/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
+++ b/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
@@ -31,6 +31,9 @@ import javax.faces.event.PhaseId;
 
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
+import org.apache.myfaces.trinidad.component.visit.VisitHint;
 import org.apache.myfaces.trinidad.event.RowDisclosureEvent;
 import org.apache.myfaces.trinidad.event.SelectionEvent;
 import org.apache.myfaces.trinidad.model.CollectionModel;
@@ -138,17 +141,36 @@ abstract public class UIXTreeTemplate extends UIXHierarchy
   {
     // this component has no facets that need to be processed once.
     // instead process the "nodeStamp" facet as many times as necessary:
-    Object oldPath = getRowKey();
-    setRowKey(null);
     HierarchyUtils.__iterateOverTree(context,
                                      phaseId,
                                      this,
                                      getDisclosedRowKeys(),
                                      true);
-    setRowKey(oldPath);
   }
 
   @Override
+  protected boolean visitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    return visitData(visitContext, callback);
+  }
+  
+  @Override
+  protected boolean visitData(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    // if we are only visiting rendered stamps, then pass in the disclosed row keys, otherwise
+    // pass in null, indicating that all row keys should be visited
+    RowKeySet disclosedRowKeys = (visitContext.getHints().contains(VisitHint.SKIP_UNRENDERED))
+                                   ? getDisclosedRowKeys()
+                                   : null;
+    
+    return visitHierarchy(visitContext, callback, getStamps(), disclosedRowKeys);
+  }
+  
+  @Override
   void __init()
   {
     super.__init();
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java
index 79ed000..870aea0 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/HierarchyUtils.java
@@ -114,44 +114,47 @@ public final class HierarchyUtils
   {
     UIComponent nodeStamp = comp.getFacet("nodeStamp");
     int oldRow = comp.getRowIndex();
-    int first = comp.getFirst();
-    int last = TableUtils.getLast(comp, first);
-    for(int i=first; i<=last; i++)
+    
+    try
     {
-      comp.setRowIndex(i);
-      if (processChildrenAsStamps)
-        TableUtils.__processStampedChildren(context, comp, phaseId);
-      comp.processComponent(context, nodeStamp, phaseId);
-      if (comp.isContainer() && (state.isContained()))
+      int first = comp.getFirst();
+      int last = TableUtils.getLast(comp, first);
+      for(int i=first; i<=last; i++)
       {
-        comp.enterContainer();
-        __iterateOverTree( context, 
-                           phaseId, 
-                           comp, 
-                           state, 
-                           processChildrenAsStamps);
-        comp.exitContainer();
+        comp.setRowIndex(i);
+        if (processChildrenAsStamps)
+          TableUtils.__processStampedChildren(context, comp, phaseId);
+        comp.processComponent(context, nodeStamp, phaseId);
+        if (comp.isContainer() && (state.isContained()))
+        {
+          comp.enterContainer();
+          
+          try
+          {
+            __iterateOverTree( context, 
+                               phaseId, 
+                               comp, 
+                               state, 
+                               processChildrenAsStamps);
+          }
+          finally
+          {
+            comp.exitContainer();
+          }
+        }
       }
     }
-    comp.setRowIndex(oldRow);
-  }
-
-  // sets the currency to the row or container that we want to start rendering
-  // from:
-  static boolean __setStartLevelPath(
-    UIXHierarchy component,
-    int          startDepth
-  )
-  {
-    return HierarchyUtils.__setStartDepthPath(component, startDepth);
+    finally
+    {
+      comp.setRowIndex(oldRow);
+    }
   }
 
   // sets the currency to the row or container that we want to start rendering
   // from:
   static boolean __setStartDepthPath(
     UIXHierarchy component,
-    int          startDepth
-  )
+    int          startDepth)
   {
     boolean isNewPath = false;
     Object focusKey = component.getFocusRowKey();
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java
index bde0858..841dd09 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/StampState.java
@@ -116,12 +116,6 @@ final class StampState implements Externalizable
   public static void restoreStampState(FacesContext context, UIComponent stamp,
                                        Object stampState)
   {
-    String stampId = stamp.getId();
-    // Force the ID to be reset to reset the client identifier (needed
-    // for UIComponentBase implementation which caches clientId too
-    // aggressively)
-    stamp.setId(stampId);
-
     if (stampState != null)
     {
       RowState state = (RowState) stampState;
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java
index 5d00642..3a27363 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/TableUtils.java
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.trinidad.component;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -280,6 +279,9 @@ public final class TableUtils
       @Override
       protected void process(FacesContext context, UIComponent child)
       {
+        // make sure that any cached clientIds are cleared so that
+        // the clientIds are recalculated with the new row index
+        UIXComponent.clearCachedClientIds(child);
         table.processComponent(context, child, phaseId);
       }
     }.runAlways(context, table);
@@ -299,11 +301,11 @@ public final class TableUtils
     int childCount = comp.getChildCount();
     if (childCount != 0)
     {
-      List children = comp.getChildren();
+      List<UIComponent> children = comp.getChildren();
 
       for (int i = 0; i < childCount; i++)
       {
-        UIComponent child = (UIComponent)children.get(i);
+        UIComponent child = children.get(i);
         comp.processComponent(context, child, phaseId);
       }
     }          
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
index 7b8ff6c..1b3ec68 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXCollection.java
@@ -23,6 +23,7 @@ import java.io.ObjectInputStream;
 import java.io.Serializable;
 
 import java.util.AbstractMap;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -40,6 +41,10 @@ import javax.faces.render.Renderer;
 
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
+import org.apache.myfaces.trinidad.component.visit.VisitHint;
+import org.apache.myfaces.trinidad.component.visit.VisitResult;
 import org.apache.myfaces.trinidad.event.SelectionEvent;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.model.CollectionModel;
@@ -294,7 +299,9 @@ public abstract class UIXCollection extends UIXComponentBase
     }
     else
     {
-      superState = stampState = clientKeyMgr = null;
+      superState = null;
+      stampState = null;
+      clientKeyMgr = null;
     }
     super.restoreState(context, superState);
 
@@ -320,7 +327,7 @@ public abstract class UIXCollection extends UIXComponentBase
   /**
    * Checks to see if the current row is available. This is useful when the
    * total number of rows is not known.
-   * @see CollectionModel#isRowAvailable
+   * @see CollectionModel#isRowAvailable()
    * @return true iff the current row is available.
    */
   public final boolean isRowAvailable()
@@ -427,7 +434,7 @@ public abstract class UIXCollection extends UIXComponentBase
 
   /**
    * Gets the data for the current row.
-   * @see CollectionModel#getRowData
+   * @see CollectionModel#getRowData(int)
    * @return null if the current row is unavailable
    */
   public final Object getRowData()
@@ -536,7 +543,7 @@ public abstract class UIXCollection extends UIXComponentBase
   /**
    * Clear the rowKey-to-currencyString cache.
    * The cache is not cleared immediately; instead it will be cleared
-   * when {@link #encodeBegin} is called.
+   * when {@link #encodeBegin(FacesContext)} is called.
    * @deprecated Have your Renderer implement {@link ClientRowKeyManagerFactory}
    * and create your own {@link ClientRowKeyManager} instances. Then you can
    * manage the lifecycle of each key inside your ClientRowKeyManager.
@@ -800,6 +807,11 @@ public abstract class UIXCollection extends UIXComponentBase
     }
 
     _restoreStampState();
+
+    // ensure the client IDs are reset on the component, otherwise they will not get the
+    // proper stamped IDs. This mirrors the behavior in UIData and follows the JSF specification
+    // on when client IDs are allowed to be cached and when they must be reset
+    clearCachedClientIds();
   }
 
   /**
@@ -856,7 +868,7 @@ public abstract class UIXCollection extends UIXComponentBase
     // just having stamp state, and having stamp state + child/facet state
     assert(!(stampState instanceof Object[]));
 
-    int facetCount = _getFacetCount(stamp);
+    int facetCount = stamp.getFacetCount();
 
     Object[] state = null;
 
@@ -943,11 +955,6 @@ public abstract class UIXCollection extends UIXComponentBase
     // Just a transient component - return
     if ((stampState == Transient.TRUE) || (stampState == null))
     {
-      // ensure the client IDs are reset on the component, otherwise they will not get the
-      // proper stamped IDs. This mirrors the behavior in UIData and follows the JSF specification
-      // on when client IDs are allowed to be cached and when they must be reset
-      String id = stamp.getId();
-      stamp.setId(id);
       return;
     }
 
@@ -997,7 +1004,7 @@ public abstract class UIXCollection extends UIXComponentBase
 
   /**
    * Process a component.
-   * This method calls {@link #processDecodes},
+   * This method calls {@link #processDecodes(FacesContext)},
    * {@link #processValidators} or
    * {@link #processUpdates}
    * depending on the {#link PhaseId}.
@@ -1147,6 +1154,268 @@ public abstract class UIXCollection extends UIXComponentBase
   }
 
   /**
+   * <p>
+   * Override default children visiting code to visit the facets and facets of the columns
+   * before delegating to the <code>visitData</code> to visit the individual rows of data.
+   * </p><p>
+   * Subclasses should override this method if they wish to change the way in which the non-stamped
+   * children are visited.  If they wish to change the wash the the stamped children are visited,
+   * they should override <code>visitData</code> instead.
+   * </p>
+   * @param visitContext
+   * @param callback
+   * @return <code>true</code> if all of the children to visit have been visited
+   * @see #visitData
+   */
+  @Override
+  protected boolean visitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    return defaultVisitChildren(visitContext, callback);
+  }
+  
+  protected final boolean defaultVisitChildren(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    boolean doneVisiting;
+    
+    // Clear out the row index if one is set so that
+    // we start from a clean slate.
+    int oldRowIndex = getRowIndex();
+    setRowIndex(-1);
+
+    try
+    {
+      // visit the unstamped children
+      doneVisiting = visitUnstampedFacets(visitContext, callback);
+      
+      if (!doneVisiting)
+      {
+        doneVisiting = _visitStampedColumnFacets(visitContext, callback);
+        
+        // visit the stamped children
+        if (!doneVisiting)
+        {
+          doneVisiting = visitData(visitContext, callback);
+        }
+      }
+    }
+    finally
+    {
+      // restore the original rowIndex
+      setRowIndex(oldRowIndex);      
+    }
+    
+    return doneVisiting;    
+  }
+  
+  /**
+   * Hook method for subclasses to override to change the behavior
+   * of how unstamped facets of the UIXCollection are visited.  The
+   * Default implementation visits all of the facets of the
+   * UIXCollection.
+   */
+  protected boolean visitUnstampedFacets(
+    VisitContext  visitContext,
+    VisitCallback callback)
+  {
+    // Visit the facets with no row
+    if (getFacetCount() > 0)
+    {
+      for (UIComponent facet : getFacets().values())
+      {
+        if (UIXComponent.visitTree(visitContext, facet, callback))
+        {
+          return true;
+        }
+      }
+    }
+
+    return false;
+  }
+  
+  /**
+   * Wrapper implementation of VisitContext
+   */
+  private static abstract class VisitContextWrapper extends VisitContext
+  {
+    protected abstract VisitContext getWrapped();
+
+    @Override
+    public FacesContext getFacesContext()
+    {
+      return getWrapped().getFacesContext();
+    }
+    
+    @Override
+    public PhaseId getPhaseId()
+    {
+      return getWrapped().getPhaseId();
+    }
+
+    @Override
+    public Collection<String> getIdsToVisit()
+    {
+      return getWrapped().getIdsToVisit();
+    }
+
+    @Override
+    public Collection<String> getSubtreeIdsToVisit(UIComponent component)
+    {
+      return getWrapped().getSubtreeIdsToVisit(component);
+    }
+
+    @Override
+    public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)
+    {
+      return getWrapped().invokeVisitCallback(component, callback);
+    }
+
+    @Override
+    public Set<VisitHint> getHints()
+    {
+      return getWrapped().getHints();
+    }
+  }
+  
+  /**
+   * VistiContext that visits the facets of the UIXColumn children, including
+   * nested UIXColumn childrem
+   */
+  private static class ColumnFacetsOnlyVisitContext extends VisitContextWrapper
+  {
+    public ColumnFacetsOnlyVisitContext(VisitContext wrappedContext)
+    {
+      _wrapped = wrappedContext;
+    }
+    
+    @Override
+    protected VisitContext getWrapped()
+    {
+      return _wrapped;
+    }
+    
+    @Override
+    public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)
+    {
+      if (component instanceof UIXColumn)
+      {
+        if (component.getFacetCount() > 0)
+        {
+          // visit the facet children without filtering for just UIXColumn children
+          for (UIComponent facetChild : component.getFacets().values())
+          {
+            if (UIXComponent.visitTree(getWrapped(), facetChild, callback))
+              return VisitResult.COMPLETE;
+          }
+          
+          // visit the indexed children, recursively looking for more columns
+          for (UIComponent child : component.getChildren())
+          {
+            if (UIXComponent.visitTree(this, child, callback))
+              return VisitResult.COMPLETE;
+          }
+        }
+      }
+      
+      // at this point, we either have already manually processed the UIXColumn's children, or
+      // the component wasn't a UIXColumn and shouldn't be processed
+      return VisitResult.REJECT;
+    }
+    
+    private final VisitContext _wrapped;
+  }
+
+  /**
+   * VisitContext implementation that doesn't visit any of the Facets of
+   * UIXColumn children.  This is used when stamping children
+   */
+  protected static final class NoColumnFacetsVisitContext extends VisitContextWrapper
+  {
+    NoColumnFacetsVisitContext(VisitContext wrapped)
+    {
+      _wrapped = wrapped;
+    }
+
+    @Override
+    protected VisitContext getWrapped()
+    {
+      return _wrapped;
+    }
+
+    @Override
+    public VisitResult invokeVisitCallback(UIComponent component, VisitCallback callback)
+    {
+      if (component instanceof UIXColumn)
+      {
+        if (component.getChildCount() > 0)
+        {
+          // visit only the indexed children of the columns
+          for (UIComponent child : component.getChildren())
+          {
+            if (UIXComponent.visitTree(this, child, callback))
+              return VisitResult.COMPLETE;
+          }
+        }
+        
+        return VisitResult.REJECT;
+      }
+      else
+      {
+        if (UIXComponent.visitTree(getWrapped(), component, callback))
+          return VisitResult.COMPLETE;
+        else
+          return VisitResult.REJECT;
+      }
+    }
+    
+    private final VisitContext _wrapped;
+  }
+  
+  /**
+   * Implementation used to visit each stamped row
+   */
+  private boolean _visitStampedColumnFacets(
+    VisitContext      visitContext,
+    VisitCallback     callback)
+  {    
+    // visit the facets of the stamped columns
+    List<UIComponent> stamps = getStamps();
+    
+    if (!stamps.isEmpty())
+    {
+      VisitContext columnVisitingContext = new ColumnFacetsOnlyVisitContext(visitContext);
+      
+      for (UIComponent stamp : stamps)
+      {
+        if (UIXComponent.visitTree(columnVisitingContext, stamp, callback))
+        {
+          return true;
+        }
+      }
+    }
+    
+    return false;
+  }
+
+
+  /**
+   * Visit the rows and children of the columns of the collection per row-index. This should
+   * not visit row index -1 (it will be perfomed in the visitTree method). The columns
+   * themselves should not be visited, only their children in this function.
+   *
+   * @param visitContext The visiting context
+   * @param callback The visit callback
+   * @return true if the visiting should stop
+   * @see #visitChildren(VisitContext, VisitCallback)
+   */
+  protected abstract boolean visitData(
+    VisitContext  visitContext,
+    VisitCallback callback);
+
+  /**
    * Gets the CollectionModel to use with this component.
    *
    * @param createIfNull  creates the collection model if necessary
@@ -1359,7 +1628,7 @@ public abstract class UIXCollection extends UIXComponentBase
   
   /**
    * Indicates the caching strategy supported by the model
-   * @see LocalCachingStrategy
+   * @see LocalRowKeyIndex.LocalCachingStrategy
    * @return caching strategy supported by the model
    */
   public LocalRowKeyIndex.LocalCachingStrategy getCachingStrategy()
@@ -1585,21 +1854,8 @@ public abstract class UIXCollection extends UIXComponentBase
     return b.equals(a);
   }
 
-  //
-  // Optimized path that avoids creating the Facet map
-  // unless necessary
-  //
-  private int _getFacetCount(UIComponent component)
-  {
-    if (component instanceof UIXComponent)
-      return ((UIXComponent) component).getFacetCount();
-
-    return component.getFacets().size();
-  }
-
   private static final class DefaultClientKeyManager extends ClientRowKeyManager
   {
-
     public void clear()
     {
       _currencyCache.clear();
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java
index a80aa48..686a777 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponent.java
@@ -226,9 +226,9 @@ abstract public class UIXComponent extends UIComponent
    * <p>
    * If a Renderer needs to
    * collect information about its possibly flattened children before calling
-   * <code>encodeFlattenedChild(FacesContext, ComponentProcessor, Iterable<UIComponent>, Object)</code>,
+   * <code>encodeFlattenedChild(FacesContext, ComponentProcessor, Iterable&lt;UIComponent&gt;, Object)</code>,
    * it should call
-   * <code>processFlattenedChildren(FacesContext, ComponentProcessor, Iterable<UIComponent>, Object)</code>
+   * <code>processFlattenedChildren(FacesContext, ComponentProcessor, Iterable&lt;UIComponent&gt;, Object)</code>
    * to collect the information.
    * <p>
    * For each FlattenedComponent child, the <code>childProcessor</code> will
@@ -239,6 +239,10 @@ abstract public class UIXComponent extends UIComponent
    * FlattenedComponents that wish to check whether they are processed for the purpose of
    * encoding can check the ProcessingHints of the ComponentProcessingContext for the
    * presence of <code>PROCESS_FOR_ENCODING hint</code>.
+   * @param context FacesContext
+   * @param childProcessor ComponentProcessor to call on each flattened child
+   * @param children Initial set of children to flatten
+   * @param callbackContext context object to pass to the childProcessor on each invocation
    * @return <code>true</code> If any children were processed
    * @see UIXComponent#processFlattenedChildren(FacesContext, ComponentProcessor, Iterable, Object)
    * @see FlattenedComponent
@@ -326,6 +330,83 @@ abstract public class UIXComponent extends UIComponent
     return visitTree(visitContext, this, callback);
   }
 
+ /**
+  * Hook for subclasses to override the manner in which the component's children are visited.  The default
+  * implementation visits all of the children and facets of the Component.
+  * <code>setupChildrenVisitingContext</code> will have been called before this method is
+  * invoked and <code>tearDownChildrenVisitingContext</code> will be called after.
+  * respectively.  If the purpose of this visit was to encode the component and the
+  * component uses a CoreRenderer, the CoreRenderer's
+  * <code>setupChildrenEncodingContext</code> and <code>tearDownChildrenEncodingContext</code>
+  * will be called before and after this method is invoked, respectively.
+  * @param visitContext the <code>VisitContext</code> for this visit
+  * @param callback the <code>VisitCallback</code> instance
+  * @return <code>true</code> if the visit is complete.
+  * @see #setupChildrenVisitingContext
+  * @see #tearDownChildrenVisitingContext
+  * @see org.apache.myfaces.trinidad.render.CoreRenderer#setupChildrenEncodingContext
+  * @see org.apache.myfaces.trinidad.render.CoreRenderer#tearDownChildrenEncodingContext
+  */
+  protected boolean visitChildren(
+    VisitContext visitContext,
+    VisitCallback callback)
+  {
+    return _visitChildrenImpl(visitContext, this, callback);
+  }
+  
+  /**
+   * Visit all of the children of the component
+   */
+  private static boolean _visitChildrenImpl(
+    VisitContext visitContext,
+    UIComponent   component,
+    VisitCallback callback)
+  {
+    // visit the children of the component
+    Iterator<UIComponent> kids = component.getFacetsAndChildren();
+
+    while(kids.hasNext())
+    {
+      boolean done;
+
+      UIComponent currChild = kids.next();
+
+      if (currChild instanceof UIXComponent)
+      {
+        UIXComponent uixChild = (UIXComponent)currChild;
+
+        // delegate to UIXComponent's visitTree implementation to allow
+        // subclassses to modify the behavior
+        done = uixChild.visitTree(visitContext, callback);
+      }
+      else
+      {
+        // use generic visit implementation
+        done = visitTree(visitContext, currChild, callback);
+      }
+
+      // If any kid visit returns true, we are done.
+      if (done)
+      {
+        return true;
+      }
+    }
+    
+    return false;
+  }
+
+  /**
+   * Returns <code>true</code> if the components are being visited
+   * for the purpose of encoding.
+   */
+  private static boolean _isEncodingVisit(VisitContext visitContext)
+  {
+    PhaseId phaseId = visitContext.getPhaseId();
+
+    return((PhaseId.RENDER_RESPONSE == phaseId) &&
+           visitContext.getHints().contains(VisitHint.EXECUTE_LIFECYCLE));
+  }
+  
   /**
   * <p>Perform a tree visit starting at the specified node in the tree.</p>
   *
@@ -350,10 +431,15 @@ abstract public class UIXComponent extends UIComponent
   * @see VisitContext#invokeVisitCallback VisitContext.invokeVisitCallback()
   */
   public static boolean visitTree(
-    VisitContext visitContext,
+    VisitContext  visitContext,
     UIComponent   component,
     VisitCallback callback)
   {
+    FacesContext context = visitContext.getFacesContext();
+    RenderingContext rc = (_isEncodingVisit(visitContext))
+                            ? RenderingContext.getCurrentInstance()
+                            : null;
+
     UIXComponent uixComponent;
 
     // determine if we should even visit this component subtree
@@ -364,6 +450,18 @@ abstract public class UIXComponent extends UIComponent
       // delegate to the UIXComponent
       if (!uixComponent.isVisitable(visitContext))
         return false;
+
+      // UIXComponents are allowed to set up their context differently for encoding
+      // than normal processing, so behave differently if this is the RenderResponse
+      // phase
+      if (rc != null)
+      {
+        uixComponent.setupEncodingContext(context, rc);
+      }
+      else
+      {
+        uixComponent.setupVisitingContext(context);
+      }
     }
     else
     {
@@ -374,110 +472,108 @@ abstract public class UIXComponent extends UIComponent
       uixComponent = null;
     }
 
-    // invoke the callback for this component
-    VisitResult result = visitContext.invokeVisitCallback(component, callback);
-
-    if (result == VisitResult.COMPLETE)
-      return true;
-    else if (result == VisitResult.ACCEPT)
+    VisitResult visitResult = VisitResult.REJECT;
+    boolean doneVisiting = false;
+    
+    try
     {
-      // now visit the children
-      FacesContext context = visitContext.getFacesContext();
-      PhaseId phaseId = visitContext.getPhaseId();
-      RenderingContext rc = (PhaseId.RENDER_RESPONSE == phaseId)
-                              ? RenderingContext.getCurrentInstance()
-                              : null;
+    // invoke the callback for this component
+      visitResult = visitContext.invokeVisitCallback(component, callback);
 
-      if (uixComponent != null)
+      if (visitResult == VisitResult.COMPLETE)
+        doneVisiting = true;
+      else if (visitResult == VisitResult.ACCEPT)
       {
-        // assume that all UIXComponent NamingContainers always act as NamingContainers,
-        // (unlike <h:form>) and this it is OK to put the optimization where we
-        // don't visit the children if we know that we don't have any ids in this
-        // subtree to visit
-        if (uixComponent instanceof NamingContainer)
-        {
-          if (visitContext.getSubtreeIdsToVisit(uixComponent).isEmpty())
-            return false;
-        }
+        // now determine whether we need to visit the children      
+        boolean skipChildren = false;
 
-        // UIXComponents are allowed to set up their context differently for encoding
-        // than normal processing, so behave differently if this is the RenderResponse
-        // phase
-        if (PhaseId.RENDER_RESPONSE == phaseId)
+        if (uixComponent != null)
         {
-          uixComponent.setUpEncodingContext(context, rc);
+          // assume that all UIXComponent NamingContainers always act as NamingContainers,
+          // (unlike <h:form>) and this it is OK to put the optimization where we
+          // don't visit the children if we know that we don't have any ids in this
+          // subtree to visit
+          if (uixComponent instanceof NamingContainer)
+          {
+            if (visitContext.getSubtreeIdsToVisit(uixComponent).isEmpty())
+              skipChildren = true;
+          }
         }
         else
         {
-          uixComponent.setupVisitingContext(context);
-        }
-      }
-      else
-      {
-        // we only optimize walking into non-UIXComponent NamingContainers
-        // if they are UINamingConainer (which is used by <f:subview>
-        if (UINamingContainer.class == component.getClass())
-        {
-          if (visitContext.getSubtreeIdsToVisit(component).isEmpty())
-            return false;
-        }
-      }
-
-      // visit the children of the component
-      try
-      {
-        Iterator<UIComponent> kids = component.getFacetsAndChildren();
-
-        while(kids.hasNext())
-        {
-          boolean done;
-
-          UIComponent currChild = kids.next();
-
-          if (currChild instanceof UIXComponent)
-          {
-            UIXComponent uixChild = (UIXComponent)currChild;
-
-            // delegate to UIXComponent's visitTree implementation to allow
-            // subclassses to modify the behavior
-            done = uixChild.visitTree(visitContext, callback);
-          }
-          else
-          {
-            // use generic visit implementation
-            done = visitTree(visitContext, currChild, callback);
-          }
-
-          // If any kid visit returns true, we are done.
-          if (done)
+          // we only optimize walking into non-UIXComponent NamingContainers
+          // if they are UINamingConainer (which is used by <f:subview>
+          if (UINamingContainer.class == component.getClass())
           {
-            return true;
+            if (visitContext.getSubtreeIdsToVisit(component).isEmpty())
+              skipChildren = true;
           }
         }
-      }
-      finally
-      {
-        // tear down the context we set up in order to visit our children
-        if (uixComponent != null)
+  
+        // visit the children of the component if we aren't supposed to skip them
+        if (!skipChildren)
         {
-          if (PhaseId.RENDER_RESPONSE == phaseId)
+          if (uixComponent != null)
           {
-            uixComponent.tearDownEncodingContext(context, rc);
+            // setup any context needed for visiting the children of the component as opposed
+            // to the component itself
+            if (rc != null)
+            {
+              uixComponent._setupChildrenEncodingContext(context, rc);
+            }
+            else
+            {
+              uixComponent.setupChildrenVisitingContext(context);
+            }
+            
+            
+            try
+            {
+              doneVisiting =  uixComponent.visitChildren(visitContext, callback);
+            }
+            finally
+            {
+              // teardown any context initialized above
+              if (rc != null)
+              {
+                uixComponent._tearDownChildrenEncodingContext(context, rc);
+              }
+              else
+              {
+                uixComponent.tearDownChildrenVisitingContext(context);
+              }
+            }
           }
           else
           {
-            uixComponent.tearDownVisitingContext(context);
+            doneVisiting = _visitChildrenImpl(visitContext, component, callback);
           }
         }
       }
+      else
+      {
+        // don't visit the children
+        assert(visitResult == VisitResult.REJECT);
+      }
     }
-    else
+    finally
     {
-      assert(result == VisitResult.REJECT);
+      // tear down the context we set up in order to visit our component
+      if (uixComponent != null)
+      {
+        if (rc != null)
+        {
+          uixComponent.tearDownEncodingContext(context, rc);
+        }
+        else
+        {
+          uixComponent.tearDownVisitingContext(context);
+        }
+      }
     }
-
+  
     // if we got this far, we're not done
-    return false;
+    return doneVisiting;
   }
 
   /**
@@ -510,6 +606,29 @@ abstract public class UIXComponent extends UIComponent
   }
 
   /**
+   * Clears all of the cached clientIds in this component subtree
+   */
+  public final void clearCachedClientIds()
+  {
+    clearCachedClientIds(this);
+  }
+
+  /**
+   * Clears all of the cached clientIds in the component's subtree
+   * @param component Component subtree to clear the cached client ids for
+   */
+  public static void clearCachedClientIds(UIComponent component)
+  {
+    String id = component.getId();
+    component.setId(id);
+    
+    Iterator<UIComponent> allChildren = component.getFacetsAndChildren();
+    
+    while (allChildren.hasNext())
+      clearCachedClientIds(allChildren.next());
+  }
+
+  /**
    * Marks this component as a partial target for this request. Typically called
    * by the {@link org.apache.myfaces.trinidad.context.RequestContext RequestContext}.
    * The component should add the client ID the desired rendered component to the context.
@@ -527,9 +646,9 @@ abstract public class UIXComponent extends UIComponent
 
   /**
    * <p>Called by
-   * {@link UIXComponent#visitTree UIXComponent.visitTree()} to determine
+   * {@link UIXComponent#visitTree(VisitContext, VisitCallback) UIXComponent.visitTree()} to determine
    * whether this component is "visitable" - ie. whether this component
-   * satisfies the {@link org.apache.myfaces.trinidad.component.visit.VisitHints} returned by
+   * satisfies the {@link org.apache.myfaces.trinidad.component.visit.VisitHint} returned by
    * {@link VisitContext#getHints VisitContext.getHints()}.</p>
    * <p>If this component is not visitable (ie. if this method returns
    * false), the tree visited is short-circuited such that neither the
@@ -537,7 +656,7 @@ abstract public class UIXComponent extends UIComponent
    * <p>Custom {@code treeVisit()} implementations may call this method
    * to determine whether the component is visitable before performing
    * any visit-related processing.</p>
-   *
+   * @param visitContext VisitingContext to use to determine if the component is visitable
    * @return true if this component should be visited, false otherwise.
    */
   protected boolean isVisitable(VisitContext visitContext)
@@ -645,11 +764,29 @@ abstract public class UIXComponent extends UIComponent
    * <code>tearDownVisitingContext</code> as well.</p>
    * <p>It is guaranteed that if <code>setupVisitingContext</code> completes
    * <code>tearDownVisitingContext</code> will be called for this component</p>
+   * @param context FacesContext
    * @see #tearDownVisitingContext
-   * @see #setUpEncodingContext
+   * @see #setupEncodingContext
    * @see #tearDownEncodingContext
    */
-  protected void setupVisitingContext(FacesContext context)
+  protected void setupVisitingContext(@SuppressWarnings("unused") FacesContext context)
+  {
+    // do nothing
+  }
+
+  /**
+   * <p>Sets up the context necessary to visit or invoke the children of a component for all phases.
+   * </p>
+   * <p>The default implementation does nothing.</p>
+   * <p>If a subclass overrides this method, it should override
+   * <code>tearDownChildrenVisitingContext</code> as well.</p>
+   * <p>It is guaranteed that if <code>setupChildrenVisitingContext</code> completes
+   * <code>tearDownChildrenVisitingContext</code> will be called for this component</p>
+   * @param context FacesContext
+   * @see #visitChildren
+   * @see #tearDownChildrenVisitingContext
+   */
+  protected void setupChildrenVisitingContext(@SuppressWarnings("unused") FacesContext context)
   {
     // do nothing
   }
@@ -662,15 +799,39 @@ abstract public class UIXComponent extends UIComponent
    * <code>setupVisitingContext</code> as well</p>
    * <p>It is guaranteed that <code>tearDownVisitingContext</code> will be called only after
    * <code>setupVisitingContext</code> has been called for this component</p>
+   * @param context FacesContext
    * @see #setupVisitingContext
-   * @see #setUpEncodingContext
+   * @see #setupEncodingContext
    * @see #tearDownEncodingContext
    */
-  protected void tearDownVisitingContext(FacesContext context)
+  protected void tearDownVisitingContext(@SuppressWarnings("unused") FacesContext context)
+  {
+    // do nothing
+  }
+
+  /**
+   * <p>Tears down context created in order to visit or invoke the children of a component
+   * for all phases.</p>
+   * <p>The default implementation does nothing.</p>
+   * <p>A subclass should only override this method if it overrode
+   * <code>setupChildrenVisitingContext</code> as well</p>
+   * <p>It is guaranteed that <code>tearDownChildrenVisitingContext</code> will be called only after
+   * <code>setupChildrenVisitingContext</code> has been called for this component</p>
+   * @param context FacesContext
+   * @see #setupChildrenVisitingContext
+   * @see #visitChildren
+   */
+  protected void tearDownChildrenVisitingContext(@SuppressWarnings("unused") FacesContext context)
   {
     // do nothing
   }
 
+  @Deprecated
+  protected final void setUpEncodingContext(FacesContext context, RenderingContext rc)
+  {
+    setupEncodingContext(context, rc);
+  }
+
   /**
    * <p>Sets up the context necessary to encode the component.</p>
    * <p>The default implementation delegates to
@@ -680,12 +841,14 @@ abstract public class UIXComponent extends UIComponent
    * <code>tearDownEncodingContext</code> as well.</p>
    * <p>It is guaranteed that if <code>setUpEncodingContext</code> completes
    * <code>tearDownEncodingContext</code> will be called for this component</p>
+   * @param context The FacesContext
+   * @param rc      RenderingContext to use for encoding
    * @see #setupVisitingContext
    * @see #tearDownVisitingContext
    * @see #tearDownEncodingContext
    * @see CoreRenderer#setupEncodingContext
    */
-  protected void setUpEncodingContext(FacesContext context, RenderingContext rc)
+  protected void setupEncodingContext(FacesContext context, RenderingContext rc)
   {
     setupVisitingContext(context);
 
@@ -700,17 +863,41 @@ abstract public class UIXComponent extends UIComponent
   }
 
   /**
+   * Sets the context necessary to encode the children of a component.
+   * @param context The FacesContext
+   * @param rc      RenderingContext to use for encoding
+   * @see #setupChildrenVisitingContext
+   * @see #_tearDownChildrenEncodingContext
+   * @see org.apache.myfaces.trinidad.render.CoreRenderer#setupChildrenEncodingContext
+   */
+  private void _setupChildrenEncodingContext(FacesContext context, RenderingContext rc)
+  {
+    setupChildrenVisitingContext(context);
+
+    Renderer renderer = getRenderer(context);
+
+    if (renderer instanceof CoreRenderer)
+    {
+      CoreRenderer coreRenderer = (CoreRenderer)renderer;
+
+      coreRenderer.setupChildrenEncodingContext(context, rc, this);
+    }    
+  }
+
+  /**
    * <p>Tears down the context created in order to encode the component</p>
    * <p>The default implementation delegates to
    * <code>CoreRenderer.tearDownEncodingContext</code> and then calls
    * <code>tearDownVisitingContext</code></p>
    * <p>A subclass should only override this method if it overrode
-   * <code>setUpEncodingContext</code> as well</p>
+   * <code>setupEncodingContext</code> as well</p>
    * <p>It is guaranteed that <code>tearDownEncodingContext</code> will be called only after
-   * <code>setUpEncodingContext</code> has been called for this component</p>
-   * @see #setUpEncodingContext
+   * <code>setupEncodingContext</code> has been called for this component</p>
+   * @param context The FacesContext
+   * @param rc      RenderingContext to use for encoding
+   * @see #setupEncodingContext
    * @see #tearDownVisitingContext
-   * @see #setUpEncodingContext
+   * @see #setupEncodingContext
    * @see CoreRenderer#tearDownEncodingContext
    */
   protected void tearDownEncodingContext(
@@ -735,6 +922,35 @@ abstract public class UIXComponent extends UIComponent
   }
 
   /**
+   * Tears down the context necessary to encode the children of a component.
+   * @param context The FacesContext
+   * @param rc      RenderingContext to use for encoding
+   * @see #setupChildrenVisitingContext
+   * @see #_tearDownChildrenEncodingContext
+   * @see org.apache.myfaces.trinidad.render.CoreRenderer#setupChildrenEncodingContext
+   */
+  private void _tearDownChildrenEncodingContext(
+    FacesContext context,
+    RenderingContext rc)
+  {
+    Renderer renderer = getRenderer(context);
+
+    try
+    {
+      if (renderer instanceof CoreRenderer)
+      {
+        CoreRenderer coreRenderer = (CoreRenderer)renderer;
+
+        coreRenderer.tearDownChildrenEncodingContext(context, rc, this);
+      }
+    }
+    finally
+    {
+      tearDownChildrenVisitingContext(context);
+    }
+  }
+
+  /**
    * Returns the FacesBean used for storing the component's state.
    */
   abstract public FacesBean getFacesBean();
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
index d886fe5..672fda8 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXComponentBase.java
@@ -304,10 +304,10 @@ abstract public class UIXComponentBase extends UIXComponent
 
   // ------------------------------------------------------------- Properties
 
-
-
-  @Override
-  public String getClientId(FacesContext context)
+  /**
+   * Calculates the clientId for the component
+   */
+  private String _calculateClientId(FacesContext context)
   {
     // the clientId is always at least the id of the current component
     // our implementation of getId() guarantees that this always
@@ -321,27 +321,53 @@ abstract public class UIXComponentBase extends UIXComponent
       if (containerComponent instanceof NamingContainer)
       {
         String contClientId;
-
+    
         // Pass additional context information to naming containers which extend UIXComponent:
         if (containerComponent instanceof UIXComponent)
           contClientId = ((UIXComponent)containerComponent).getContainerClientId(context, this);
         else
           contClientId = containerComponent.getContainerClientId(context);
-
+    
         StringBuilder bld = __getSharedStringBuilder();
         bld.append(contClientId).append(NamingContainer.SEPARATOR_CHAR).append(clientId);
         clientId = bld.toString();
         break;
       }
-
+    
       containerComponent = containerComponent.getParent();
     }
-
+    
     Renderer renderer = getRenderer(context);
     if (null != renderer)
       clientId = renderer.convertClientId(context, clientId);
+    
+    return clientId;
+  }
+  
 
+
+  @Override
+  public String getClientId(FacesContext context)
+  {
+    return _calculateClientId(context);
+/* TODO put back in when we fix all of the clientID caching issues
+    String clientId = _clientId;
+    
+    if (clientId == null)
+    {
+      clientId = _calculateClientId(context);
+      
+      if (_usesFacesBeanImpl)
+        _clientId = clientId;
+    }
+    else
+    {
+      assert clientId.equals(_calculateClientId(context)) :
+      "cached client id " + _clientId + " for " + this + " doesn't match client id:" + _calculateClientId(context);
+    }
+    
     return clientId;
+*/
   }
 
 
@@ -397,6 +423,8 @@ abstract public class UIXComponentBase extends UIXComponent
   @Override
   public void setId(String id)
   {
+    _clientId = null;
+    
     FacesBean facesBean = getFacesBean();
     
     // if we are using a FacesBeanImpl, then the FacesBean will
@@ -410,6 +438,13 @@ abstract public class UIXComponentBase extends UIXComponent
       {
         _validateId(id);
         _id = id;
+        
+        // if we're a NamingContainer then changing our id will invalidate the clientIds of all
+        // of our children
+        if ((_clientId != null) && (this instanceof NamingContainer))
+        {
+          clearCachedClientIds(this);
+        }
       }      
     }
     else
@@ -418,7 +453,7 @@ abstract public class UIXComponentBase extends UIXComponent
       facesBean.setProperty(ID_KEY, id);      
     }
   }
-
+  
   @Override
   abstract public String getFamily();
 
@@ -607,7 +642,8 @@ abstract public class UIXComponentBase extends UIXComponent
   {
     if (_children == null)
       return 0;
-    return getChildren().size();
+    else
+      return getChildren().size();
   }
 
 
@@ -631,9 +667,11 @@ abstract public class UIXComponentBase extends UIXComponent
   {
     if (facetName == null)
       throw new NullPointerException();
+    
     if (_facets == null)
       return null;
-    return getFacets().get(facetName);
+    else
+      return getFacets().get(facetName);
   }
 
 
@@ -648,7 +686,8 @@ abstract public class UIXComponentBase extends UIXComponent
   {
     if (_facets == null)
       return _EMPTY_STRING_ITERATOR;
-    return _facets.keySet().iterator();
+    else
+      return _facets.keySet().iterator();
   }
 
   @Override
@@ -1659,6 +1698,7 @@ abstract public class UIXComponentBase extends UIXComponent
   private Map<String, UIComponent> _facets;
   private UIComponent              _parent;
   private String                   _id;
+  private String                   _clientId;
   private boolean                  _usesFacesBeanImpl;
   
   // Cached instance of the Renderer for this component.
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java
index a9ec25a..414301f 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/UIXHierarchy.java
@@ -6,9 +6,9 @@
  *  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
@@ -19,11 +19,12 @@
 package org.apache.myfaces.trinidad.component;
 
 import java.util.Collections;
-
 import java.util.List;
 
 import javax.faces.component.UIComponent;
 
+import org.apache.myfaces.trinidad.component.visit.VisitCallback;
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
 import org.apache.myfaces.trinidad.model.CollectionModel;
 import org.apache.myfaces.trinidad.model.LocalRowKeyIndex;
 import org.apache.myfaces.trinidad.model.ModelUtils;
@@ -37,7 +38,7 @@ import org.apache.myfaces.trinidad.model.TreeModel;
  *
  * @version $Name:  $ ($Revision: adfrt/faces/adf-faces-api/src/main/java/oracle/adf/view/faces/component/UIXHierarchy.java#0 $) $Date: 10-nov-2005.19:09:52 $
  */
-abstract public class UIXHierarchy extends UIXCollection implements CollectionComponent, LocalRowKeyIndex, 
+public abstract class UIXHierarchy extends UIXCollection implements CollectionComponent, LocalRowKeyIndex, 
              TreeLocalRowKeyIndex
 {
   /**
@@ -58,7 +59,7 @@ abstract public class UIXHierarchy extends UIXCollection implements CollectionCo
   public CollectionModel createCollectionModel(CollectionModel current, Object value)
   {
     TreeModel model = ModelUtils.toTreeModel(value);
-    model.setRowKey(null);    
+    model.setRowKey(null);
     return model;
   }
 
@@ -80,7 +81,7 @@ abstract public class UIXHierarchy extends UIXCollection implements CollectionCo
   public int getRows()
   {
     return 0;
-  }  
+  }
   
   /**
   * Treats the current element as a parent element and steps into the children.
@@ -128,7 +129,6 @@ abstract public class UIXHierarchy extends UIXCollection implements CollectionCo
    */
   public boolean isContainerEmpty()
   {
-    
     return getTreeModel().isContainerEmpty();
   }
 
@@ -265,7 +265,6 @@ abstract public class UIXHierarchy extends UIXCollection implements CollectionCo
     return getTreeModel().areRowsLocallyAvailable(rowCount, disclosedRowKeys);
   }
 
-
   /**
    * Gets the TreeModel that this tree is displaying.
    */
@@ -273,7 +272,7 @@ abstract public class UIXHierarchy extends UIXCollection implements CollectionCo
   {
     TreeModel model = (TreeModel) getCollectionModel();
     return model;
-  } 
+  }
   
   @Override
   protected List<UIComponent> getStamps()
@@ -283,7 +282,94 @@ abstract public class UIXHierarchy extends UIXCollection implements CollectionCo
       return Collections.singletonList(nodeStamp);
     else
       return Collections.emptyList();
-  }  
+  }
 
   abstract public Object getFocusRowKey();
+
+  protected final boolean visitLevel(
+    VisitContext      visitContext,
+    VisitCallback     callback,
+    List<UIComponent> stamps)
+  {
+    if (getRowCount() != 0)
+    {      
+      if (!stamps.isEmpty())
+      {
+        int oldRow = getRowIndex();
+        int first = getFirst();
+        int last = TableUtils.getLast(this, first);
+
+        try
+        {
+          for (int i = first; i <= last; i++)
+          {
+            setRowIndex(i);
+
+            for (UIComponent currStamp : stamps)
+            {
+              // visit the stamps.  If we have visited all of the visit targets then return early
+              if (UIXComponent.visitTree(visitContext, currStamp, callback))
+                return true;
+            }
+          }
+        }
+        finally
+        {
+          setRowIndex(oldRow);          
+        }
+      }
+    }
+    
+    return false;
+  }
+  
+  protected final boolean visitHierarchy(
+    VisitContext      visitContext,
+    VisitCallback     callback,
+    List<UIComponent> stamps,
+    RowKeySet         disclosedRowKeys)
+  {
+    int oldRow = getRowIndex();
+    int first = getFirst();
+    int last = TableUtils.getLast(this, first);
+
+    try
+    {  
+      for(int i = first; i <= last; i++)
+      {
+        setRowIndex(i);
+        if (!stamps.isEmpty())
+        {
+          for (UIComponent currStamp : stamps)
+          {
+            // visit the stamps.  If we have visited all of the visit targets then return early
+            if (UIXComponent.visitTree(visitContext, currStamp, callback))
+              return true;
+          }
+        }
+                
+        if (isContainer() && ((disclosedRowKeys == null) || disclosedRowKeys.isContained()))
+        {
+          enterContainer();
+          
+          try
+          {
+            // visit this container.  If we have visited all of the visit targets then return early
+            if (visitHierarchy(visitContext, callback, stamps, disclosedRowKeys));
+              return true;
+          }
+          finally
+          {
+            exitContainer();
+          }
+        }
+      }
+    }
+    finally
+    {
+      setRowIndex(oldRow);
+    }    
+ 
+    return false;
+  }
 }
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/visit/VisitCallback.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/visit/VisitCallback.java
index cebb081..e1b701c 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/visit/VisitCallback.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/visit/VisitCallback.java
@@ -27,7 +27,8 @@ import javax.faces.component.UIComponent;
  * taking action on a specific UIComponent (either facet or child) during 
  * a component tree visit.</p>
  *
- * @see org.apache.myfaces.trinidad.component.UIXComponent#visitTree UIComponent.visitTree()
+ * @see org.apache.myfaces.trinidad.component.UIXComponent#visitTree(VisitContext, VisitCallback)
+ * UIComponent.visitTree()
  */
 public interface VisitCallback
 {
@@ -39,7 +40,7 @@ public interface VisitCallback
      * to be in the proper state with respect to its ancestors in the
      * View.</p>
      *
-     * @param context the {@link VisitContext} for this tree visit.
+     * @param visitContext the {@link VisitContext} for this tree visit.
      *
      * @param target the {@link UIComponent} to visit
      *
@@ -47,5 +48,5 @@ public interface VisitCallback
      *   visiting the component's subtree, skip visiting the component's
      *   subtree or end the visit.
      */
-    public VisitResult visit(VisitContext context, UIComponent target);
+    public VisitResult visit(VisitContext visitContext, UIComponent target);
 }
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/visit/VisitContext.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/visit/VisitContext.java
index 8e70308..8ada868 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/visit/VisitContext.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/component/visit/VisitContext.java
@@ -34,11 +34,12 @@ import javax.faces.event.PhaseId;
  * state relating to a component tree visit.</p>
  *
  * <p>Component tree visits are initiated by calling
- * {@link org.apache.myfaces.trinidad.component.UIXComponent#visitTree UIComponent.visitTree()},
+ * {@link org.apache.myfaces.trinidad.component.UIXComponent#visitTree(VisitContext,UIComponent,VisitCallback)
+ * UIComponent.visitTree()},
  * at which point both a {@link VisitContext} and a {@link VisitCallback}
  * must be provided.
  *
- * @see org.apache.myfaces.trinidad.component.UIXComponent#visitTree UIXComponent.visitTree()
+ * @see org.apache.myfaces.trinidad.component.UIXComponent#visitTree(VisitContext,UIComponent,VisitCallback) UIXComponent.visitTree()
  * @see VisitCallback
  *
  */
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
index e967c00..f470909 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
@@ -96,7 +96,7 @@ public class CoreRenderer extends Renderer
 
   /**
    * <p>
-   * Called before rendering the current component's children in order to set
+   * Called before rendering the current comopnent's children in order to set
    * up any special context.
    * </p>
    * <p>If <code>setupEncodingContext</code> succeeds then
@@ -105,31 +105,53 @@ public class CoreRenderer extends Renderer
    * <p>The default implementation does nothing</p>
    * @param context FacesContext for this request
    * @param rc RenderingContext for this encoding pass
-   * @ param component Component to encode using this Renderer
+   * @param component Component to encode using this Renderer
    * @see #tearDownEncodingContext
    */
   public void setupEncodingContext(
     FacesContext context,
     RenderingContext rc,
-    UIXComponent component)
+    UIComponent component)
   {
+    // TODO Remove after one release
+    if (component instanceof UIXComponent)
+      setupEncodingContext(context, rc, (UIXComponent)component);
   }
 
+  // TODO Remove after one release
+  @Deprecated
   public void setupEncodingContext(
-    FacesContext context,
-    RenderingContext rc,
-    UIComponent component)
+    @SuppressWarnings("unused") FacesContext context,
+    @SuppressWarnings("unused") RenderingContext rc,
+    @SuppressWarnings("unused") UIXComponent component)
   {
-    // temporary hack to change UIComponent.  Once the change has propagated through, we will
-    // remove the UIXComponent version.
-    // We need to support UIComponents so that we can use CoreRenderers against non-UIXComponents
-    if (component instanceof UIXComponent)
-      setupEncodingContext(context, rc, (UIXComponent)component);
   }
 
+
   /**
    * <p>
-   * Called after rendering the current component's children in order to tear
+   * Called before rendering the current component's children in order to set
+   * up any special context.
+   * </p>
+   * <p>If <code>setupChildrenEncodingContext</code> succeeds then
+   * <code>tearDownChildrenEncodingContext</code> will be called for the same component.
+   * </p>
+   * <p>The default implementation does nothing</p>
+   * @param context FacesContext for this request
+   * @param rc RenderingContext for this encoding pass
+   * @param component Component to encode using this Renderer
+   * @see #tearDownChildrenEncodingContext
+   */
+  public void setupChildrenEncodingContext(
+    @SuppressWarnings("unused") FacesContext context,
+    @SuppressWarnings("unused") RenderingContext rc,
+    @SuppressWarnings("unused") UIComponent component)
+  {
+  }
+
+  /**
+   * <p>
+   * Called after rendering the current component in order to tear
    * down any special context.
    * </p>
    * <p>
@@ -139,28 +161,49 @@ public class CoreRenderer extends Renderer
    * <p>The default implementation does nothing</p>
    * @param context FacesContext for this request
    * @param rc RenderingContext for this encoding pass
-   * @ param component Component to encode using this Renderer
+   * @param component Component to encode using this Renderer
    * @see #setupEncodingContext
    */
   public void tearDownEncodingContext(
     FacesContext context,
     RenderingContext rc,
-    UIXComponent     component)
+    UIComponent     component)
   {
+    // TODO Remove after one release
+    if (component instanceof UIXComponent)
+      tearDownEncodingContext(context, rc, (UIXComponent)component);
   }
 
+  // TODO Remove after one release
+  @Deprecated
   public void tearDownEncodingContext(
-    FacesContext context,
-    RenderingContext rc,
-    UIComponent     component)
+    @SuppressWarnings("unused") FacesContext context,
+    @SuppressWarnings("unused") RenderingContext rc,
+    @SuppressWarnings("unused") UIXComponent     component)
   {
-    // temporary hack to change UIComponent.  Once the change has propagated through, we will
-    // remove the UIXComponent version.
-    // We need to support UIComponents so that we can use CoreRenderers against non-UIXComponents
-    if (component instanceof UIXComponent)
-      tearDownEncodingContext(context, rc, (UIXComponent)component);
   }
 
+  /**
+   * <p>
+   * Called after rendering the current component's children in order to tear
+   * down any special context.
+   * </p>
+   * <p>
+   * <code>tearDownChildrenEncodingContext</code> will be called on the component if
+   * <code>setupChildrenEncodingContext</code> succeeded.
+   * </p>
+   * <p>The default implementation does nothing</p>
+   * @param context FacesContext for this request
+   * @param rc RenderingContext for this encoding pass
+   * @param component Component to encode using this Renderer
+   * @see #setupChildrenEncodingContext
+   */
+  public void tearDownChildrenEncodingContext(
+    @SuppressWarnings("unused") FacesContext context,
+    @SuppressWarnings("unused") RenderingContext rc,
+    @SuppressWarnings("unused") UIComponent component)
+  {
+  }
 
   //
   // COERCION HELPERS
@@ -223,6 +266,7 @@ public class CoreRenderer extends Renderer
    * Coerces an object into a resource URI, calling the view-handler.
    * @deprecated use toResourceUri
    */
+  @Deprecated
   static public String toUri(Object o)
   {
     return toResourceUri(FacesContext.getCurrentInstance(),o);
diff --git a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/CollectionUtils.java b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/CollectionUtils.java
index 6e26ed2..b1495f8 100644
--- a/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/CollectionUtils.java
+++ b/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/CollectionUtils.java
@@ -1288,8 +1288,6 @@ public final class CollectionUtils
   private static final Class<? extends List> _SYNCHRONIZED_LIST;
   private static final Class<? extends Set> _EMPTY_SET = Collections.emptySet().getClass();
   private static final Class<? extends Set> _SINGLETON_SET = Collections.singleton(null).getClass();
-  
-
   private static final Queue _EMPTY_QUEUE = new EmptyQueue();
   private static final Iterator _EMPTY_ITERATOR = new EmptyIterator();
   private static final Iterator _EMPTY_LIST_ITERATOR = new EmptyListIterator();
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIComponentTestCase.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIComponentTestCase.java
index 4cbadc7..f3bd435 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIComponentTestCase.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIComponentTestCase.java
@@ -26,6 +26,8 @@ import java.io.IOException;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+
+import java.util.Collections;
 import java.util.Map;
 import javax.faces.component.EditableValueHolder;
 import javax.faces.component.UIComponent;
@@ -692,6 +694,8 @@ public class UIComponentTestCase extends FacesTestCase
     
     mock.stubs().method("getParent").will(returnValue(null));
     mock.stubs().method("setParent");
+    mock.stubs().method("getFacetsAndChildren").will(returnIterator(Collections.emptyList()));
+
     mock.expects(never()).method("processRestoreState");
     mock.expects(never()).method("processDecodes");
     mock.expects(never()).method("processValidators");
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXProcessTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXProcessTest.java
index 1b1f7c1..db1854b 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXProcessTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/UIXProcessTest.java
@@ -20,12 +20,16 @@ package org.apache.myfaces.trinidad.component;
 
 import java.io.IOException;
 
+import javax.faces.component.UIComponentBase;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 import junit.textui.TestRunner;
 
 import org.apache.myfaces.trinidad.component.UIComponentTestCase;
 
+import org.jmock.Mock;
+
 /**
  * Unit tests for UIXProcess
  *
@@ -133,4 +137,16 @@ public class UIXProcessTest extends UIComponentTestCase
     UIXProcess component = new UIXProcess();
     doTestRenderResponse(component);
   }
+  
+  protected Mock createMockUIComponent()
+  {
+    // the UIXProcess is allowed to call getId and setId on its child
+    Mock mock = super.createMockUIComponent();
+    
+    mock.stubs().method("getId");
+    mock.stubs().method("setId");
+        
+    return mock;
+  }
+
 }
diff --git a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/core/nav/CoreBreadCrumbsTest.java b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/core/nav/CoreBreadCrumbsTest.java
index a546087..e611286 100644
--- a/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/core/nav/CoreBreadCrumbsTest.java
+++ b/trinidad-api/src/test/java/org/apache/myfaces/trinidad/component/core/nav/CoreBreadCrumbsTest.java
@@ -25,6 +25,8 @@ import junit.framework.TestSuite;
 
 import org.apache.myfaces.trinidad.component.UIComponentTestCase;
 
+import org.jmock.Mock;
+
 /**
  * Unit tests for CoreBreadCrumbs.
  *
@@ -136,4 +138,15 @@ public class CoreBreadCrumbsTest extends UIComponentTestCase
     CoreBreadCrumbs component = new CoreBreadCrumbs();
     doTestRenderResponse(component);
   }
+
+  protected Mock createMockUIComponent()
+  {
+    // the BreadCrumbs is allowed to call getId and setId on its child
+    Mock mock = super.createMockUIComponent();
+    
+    mock.stubs().method("getId");
+    mock.stubs().method("setId");
+        
+    return mock;
+  }
 }
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FullVisitContext.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FullVisitContext.java
index 1fbe0a9..4ce13ac 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FullVisitContext.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FullVisitContext.java
@@ -33,6 +33,7 @@ import org.apache.myfaces.trinidad.component.visit.VisitCallback;
 import org.apache.myfaces.trinidad.component.visit.VisitContext;
 import org.apache.myfaces.trinidad.component.visit.VisitHint;
 import org.apache.myfaces.trinidad.component.visit.VisitResult;
+import org.apache.myfaces.trinidad.util.CollectionUtils;
 
 /**
  *
@@ -80,11 +81,10 @@ class FullVisitContext extends VisitContext
     _phaseId = phaseId;
 
     // Copy and store hints - ensure unmodifiable and non-empty
-    EnumSet<VisitHint> hintsEnumSet = ((hints == null) || (hints.isEmpty()))
-                                          ? EnumSet.noneOf(VisitHint.class)
-                                          : EnumSet.copyOf(hints);
-
-    _hints = Collections.unmodifiableSet(hintsEnumSet);
+    if (hints == null)
+      _hints = Collections.emptySet();
+    else
+      _hints = CollectionUtils.unmodifiableCopyOfEnumSet(hints);
   }
 
   /**
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/PartialVisitContext.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/PartialVisitContext.java
index a03d8c8..ba21daf 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/PartialVisitContext.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/PartialVisitContext.java
@@ -41,6 +41,7 @@ import org.apache.myfaces.trinidad.component.visit.VisitCallback;
 import org.apache.myfaces.trinidad.component.visit.VisitContext;
 import org.apache.myfaces.trinidad.component.visit.VisitHint;
 import org.apache.myfaces.trinidad.component.visit.VisitResult;
+import org.apache.myfaces.trinidad.util.CollectionUtils;
 
 /**
  * <p>A VisitContext implementation that is
@@ -130,12 +131,11 @@ class PartialVisitContext extends VisitContext
     _clientIds.addAll(clientIdSet);
 
     // Copy and store hints - ensure unmodifiable and non-empty
-    EnumSet<VisitHint> hintsEnumSet = ((hints == null) || (hints.isEmpty()))
-                                        ? EnumSet.noneOf(VisitHint.class)
-                                        : EnumSet.copyOf(hints);
-
-    _hints = Collections.unmodifiableSet(hintsEnumSet);
-  }
+    if (hints == null)
+      _hints = Collections.emptySet();
+    else
+      _hints = CollectionUtils.unmodifiableCopyOfEnumSet(hints);
+   }
 
   /**
    * @see VisitContext#getFacesContext VisitContext.getFacesContext()
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/ppr/PartialPageContextImpl.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/ppr/PartialPageContextImpl.java
index eee38c2..d255191 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/ppr/PartialPageContextImpl.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/ppr/PartialPageContextImpl.java
@@ -378,8 +378,6 @@ public class PartialPageContextImpl extends PartialPageContext
     {
       // First sure that we should visit this component - ie.
       // that this component is represented in our id set.
-      String clientId = _getVisitId(component);
-
       VisitResult result;
      
       if (component instanceof UIXComponent)
@@ -422,33 +420,12 @@ public class PartialPageContextImpl extends PartialPageContext
     public Set<VisitHint> getHints()
     {
       return _PPR_VISIT_HINTS;
-    }
-
-    // Tests whether the specified component should be visited.
-    // If so, returns its client id.  If not, returns null.
-    private String _getVisitId(UIComponent component)
-    {
-      // We first check to see whether the component's id
-      // is in our id collection.  We do this before checking
-      // for the full client id because getting the full client id
-      // is more expensive than just getting the local id.
-      String id = component.getId();
-
-      if ((id != null) && !_targetIds.contains(id))
-        return null;
-
-      // The id was a match - now check the client id.
-      // note that client id should never be null (should be
-      // generated even if id is null, so asserting this.)
-      String clientId = component.getClientId(getFacesContext());
-      assert(clientId != null);
-
-      return _targets.containsKey(clientId) ? clientId : null;
-    }                                                                      
+    }                                                             
   }
 
-  private static final Set<VisitHint> _PPR_VISIT_HINTS = EnumSet.of(VisitHint.SKIP_UNRENDERED,
-                                                                    VisitHint.EXECUTE_LIFECYCLE);
+  private static final Set<VisitHint> _PPR_VISIT_HINTS = Collections.unmodifiableSet(
+                                                         EnumSet.of(VisitHint.SKIP_UNRENDERED,
+                                                                    VisitHint.EXECUTE_LIFECYCLE));
   private final FacesContext _context;
   
   // if the value is TRUE, then this target has been rendered.  If false, it has yet to be rendered
diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java
index 6e03fd3..afee029 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/FormRenderer.java
@@ -105,15 +105,6 @@ public class FormRenderer extends XhtmlRenderer
     _targetFrameKey = type.findKey("targetFrame");
   }
 
-  @Override
-  public void setupEncodingContext(
-    FacesContext context,
-    RenderingContext rc,
-    UIXComponent component)
-  {
-    // temp hack
-    setupEncodingContext(context, rc, (UIComponent)component);
-  }
   
   @Override
   public void setupEncodingContext(
@@ -425,16 +416,6 @@ public class FormRenderer extends XhtmlRenderer
     if (postscriptId != null)
       rw.endElement("span");
   }
-
-  @Override
-  public void tearDownEncodingContext(
-    FacesContext context,
-    RenderingContext rc,
-    UIXComponent     component)
-  {
-    // temp hack
-    tearDownEncodingContext(context, rc, (UIComponent)component);
-  }
   
   @Override
   public void tearDownEncodingContext(

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.

[myfaces-trinidad] 07/36: TRINIDAD-1692 remove newlines in css file if in compressed mode This is in CSSGenerationUtils

Posted by de...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

deki pushed a commit to branch 1.2.12.2-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad.git

commit 9d9fd39113aa73039c60b6c29f4915a45a01182a
Author: Jeanne Waldman <jw...@apache.org>
AuthorDate: Thu Jan 21 02:37:16 2010 +0000

    TRINIDAD-1692 remove newlines in css file if in compressed mode
    This is in CSSGenerationUtils
---
 .../myfaces/trinidadinternal/style/util/CSSGenerationUtils.java   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java
index f20d372..bdc30d8 100644
--- a/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java
+++ b/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/util/CSSGenerationUtils.java
@@ -165,7 +165,8 @@ public class CSSGenerationUtils
     // We'll start writing the CSS file now.  First
     // write out the header with a time stamp
     Date date = new Date();
-    out.println("/* This CSS file generated on " + date + " */");
+    if (!compressStyles)
+      out.println("/* This CSS file generated on " + date + " */");
 
     // Keep track of the number of selectors written out. The reason? IE has a 4095 limit,
     // and we want to warn when we get to that limit.
@@ -333,7 +334,10 @@ public class CSSGenerationUtils
           }
         }
 
-        out.println("}");
+        if (compressStyles)
+          out.print("}"); // take out the newlines for performance
+        else
+          out.println("}");
       }
     }
     out.println("/* The number of CSS selectors in this file is " + numberSelectorsWritten + " */");

-- 
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.