users@javaserverfaces-spec-public.java.net

[jsr344-experts mirror] [jsr344-experts] Re: [1089-HTML5-data-*attributes] PROPOSAL

From: Edward Burns <edward.burns_at_oracle.com>
Date: Wed, 6 Jun 2012 12:44:15 -0700

>>>>> On Wed, 6 Jun 2012 11:37:28 -0700 (PDT), Phil Webb <pwebb_at_vmware.com> said:

PW> Thanks Andy, this is a fantastic summary that really helps clarify
PW> the issues.

[...] Yes, thanks, it is an excellent and actionable summary. Thanks
for taking it on.

PW> 6: +1 for user override. This leads to an interesting question
PW> about how passthough attributes are rendered. At a technical level
PW> it feels like existing renderers will need to be changed. Do we
PW> need a ResponseWriter.writePassThoughAttributes(UIComponent
PW> component) method. Some renderers might write more than one element
PW> so I don't see an easy way to indicate where passthough attributes
PW> are applied unless per renderer (apologies if I have missed
PW> something in the earlier emails on this).

The currently committed spec for 1089 says this in the RenderKit docs:

  determine the correct markup element to host the data-
  attribute(s). Let this element be dataHostingElement. This markup
  element will always be the outer-most markup element corresponding
  precisely to this component instance. If necessary, a <div> or a
  <span> must be rendered to host the data- attribute(s), depending on
  whether or not the component is, itself, block or inline in
  nature. For each entry in the map, do the following.

  If the key is a ValueExpression get its value and append it to the
  literal string "data-", without the quotes. Otherwise get the string
  value of the key and append it to the literal string "data-" without
  the quotes. Let the result be dataAttributeName.

  If the value is a ValueExpression get its value. Otherwise get the
  string value of the entry's value. Let the result be
  dataAttributeValue.

  Render an attribute on dataHostingElement using
  ResponseWriter.writeAttribute(). The name of the attribute is
  dataAttributeName and the value of the attribute is
  dataAttributeValue. Also pass dataAttributeName as the last argument
  to ResponseWriter.writeAttribute().

https://maven.java.net/service/local/repositories/snapshots/archive/javax/faces/javax.faces-api/2.2-SNAPSHOT/javax.faces-api-2.2-20120606.080027-1-javadoc.jar/!/renderkitdocs/index.html

I am forming a detailed reply to Andy's summary and will have it out by
tomorrow morning.

Ed

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/
| 29 Business days til JSF 2.2 Public Review to EG