javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-1116

Add the possibility to change "rel" and "type" on <h:outputStylesheet>

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1 Rev a
    • Fix Version/s: None
    • Component/s: Components/Renderers
    • Labels:
      None
    • Environment:

      All

      Description

      Currently, when using a <h:outputStylesheet>, it will always generate a <link href="..." rel="stylesheet" type="text/css">, there is no way to change the value of the "rel" and "type" attributes on the generated HTML tag.

      But HTML5 is here and next technologies have emerged, like LESS, SASS ans SCSS. It would be cool to keep the actual default values but add "rel" and "type" attributes to the JSF component "outputStylesheet" so we can override them if needed.

        Activity

        Hide
        paul_dijou added a comment -

        To see the fact that "type" and "rel" are hard-coded, just check that source code: https://maven.java.net/service/local/repositories/releases/archive/com/sun/faces/jsf-impl/2.1.3/jsf-impl-2.1.3-sources.jar/!/com/sun/faces/renderkit/html_basic/StylesheetRenderer.java (it's near the end).

        Not sure even the new passthru attributes can change them...

        Show
        paul_dijou added a comment - To see the fact that "type" and "rel" are hard-coded, just check that source code: https://maven.java.net/service/local/repositories/releases/archive/com/sun/faces/jsf-impl/2.1.3/jsf-impl-2.1.3-sources.jar/!/com/sun/faces/renderkit/html_basic/StylesheetRenderer.java (it's near the end). Not sure even the new passthru attributes can change them...
        Hide
        paul_dijou added a comment -

        Also, consider the same problem with script resources. New types like Coffeescript are now possible. As we can see at the beginning of https://maven.java.net/service/local/repositories/releases/archive/com/sun/faces/jsf-impl/2.1.3/jsf-impl-2.1.3-sources.jar/!/com/sun/faces/renderkit/html_basic/ScriptRenderer.java , also here the type is hard-coded.

        Show
        paul_dijou added a comment - Also, consider the same problem with script resources. New types like Coffeescript are now possible. As we can see at the beginning of https://maven.java.net/service/local/repositories/releases/archive/com/sun/faces/jsf-impl/2.1.3/jsf-impl-2.1.3-sources.jar/!/com/sun/faces/renderkit/html_basic/ScriptRenderer.java , also here the type is hard-coded.
        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
        Hide
        Ed Burns added a comment -

        I confirmed that this doesn't work, even with passthrough elements:

        <h:outputStylesheet library="alibrary" name="favicon.ico" pt:rel="icon" pt:type="image/x-icon" />
        

        Just outputs:

        <link type="text/css" rel="stylesheet" href="/test-agnostic-renderKit-basic/faces/javax.faces.resource/favicon.ico?ln=alibrary" />
        

        This clearly is not what is intended.

        Show
        Ed Burns added a comment - I confirmed that this doesn't work, even with passthrough elements: <h:outputStylesheet library= "alibrary" name= "favicon.ico" pt:rel= "icon" pt:type= "image/x-icon" /> Just outputs: <link type= "text/css" rel= "stylesheet" href= "/test-agnostic-renderKit-basic/faces/javax.faces.resource/favicon.ico?ln=alibrary" /> This clearly is not what is intended.

          People

          • Assignee:
            Unassigned
            Reporter:
            paul_dijou
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: