ICEfaces
  1. ICEfaces
  2. ICE-7998

Meta html tag is placed at the bottom of the head section

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0, EE-3.0.0.GA, 3.3
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 3.x, IE
    • Affects:
      Compatibility/Configuration

      Description

      When using the html meta tag to force the IE browser into a specific borwser/document mode, the placement of this tag in the head section is at the bottom when using ICEfaces 3. This causes the tag to not enforce the browser settings and therefore the page gets rendered with the default browser/document mode.

      With ICEfaces 2.x the meta tag would be rendered at the top of the section:
      <head>
           <title>...</title>
           <meta>....</meta>
           <link> Default CSS/JS </link>
           ....
      </head>

      With ICEfaces 3.x it gets rendered at the bottom:
      <head>
           <title>...</title>
           <link> Default CSS/JS </link>
           <meta>....</meta>
           ....
      </head>
      1. Case11137Example.zip
        16 kB
        Arran Mccullough
      2. Case11137ExampleWAR.zip
        9.51 MB
        Arran Mccullough
      1. ICEfaces-2-meta-tag-placement.jpg
        238 kB
      2. ICEfaces-3-meta-tag-placement.jpg
        158 kB

        Issue Links

          Activity

          Hide
          Arran Mccullough added a comment -

          Screen shots showing the rendered code.

          Show
          Arran Mccullough added a comment - Screen shots showing the rendered code.
          Hide
          Arran Mccullough added a comment -

          test case that shows issue. Page should be displayed in IE8/9 Compat View + IE8 Document Mode. With ICEfaces 3 it shows as IE8/9 Compat View + IE7 Document Mode.

          Show
          Arran Mccullough added a comment - test case that shows issue. Page should be displayed in IE8/9 Compat View + IE8 Document Mode. With ICEfaces 3 it shows as IE8/9 Compat View + IE7 Document Mode.
          Hide
          Arturo Zambrano added a comment -

          What happens is that we use our custom Head renderer to make sure that the theme css file gets loaded first, then we load the rest of our required resources, and finally we load any other custom resources declared on the page and also plain HTML tags. We do this so that all custom Javascript and css resources are loaded at the bottom of <head> to allow them to override any part of our own resources. Unfortunately, it is not possible to access <meta> tags individually and load them first. All contiguous plain HTML tags are grouped as a single UIInstructions component that renders an entire block of HTML tags. So, if this block also contains a <script> or <link> tag, then they won't be able to override our own resources if they are loaded first. Perhaps, the only solution would be to create a wrapper component for <meta> tags, so we can access them individually and load them first. For now, another thing they could try is to disable the Head renderer by adding this context parameter to their web.xml:

          <context-param>
          <param-name>org.icefaces.ace.theme</param-name>
          <param-value>none</param-value>
          </context-param>

          This won't load the theme and will load all plain HTML tags in <h:head> first (i.e. normal behaviour of <h:head>). Then, they could try to load a theme by using <h:outputStylesheet> or plain <link> tags.

          Show
          Arturo Zambrano added a comment - What happens is that we use our custom Head renderer to make sure that the theme css file gets loaded first, then we load the rest of our required resources, and finally we load any other custom resources declared on the page and also plain HTML tags. We do this so that all custom Javascript and css resources are loaded at the bottom of <head> to allow them to override any part of our own resources. Unfortunately, it is not possible to access <meta> tags individually and load them first. All contiguous plain HTML tags are grouped as a single UIInstructions component that renders an entire block of HTML tags. So, if this block also contains a <script> or <link> tag, then they won't be able to override our own resources if they are loaded first. Perhaps, the only solution would be to create a wrapper component for <meta> tags, so we can access them individually and load them first. For now, another thing they could try is to disable the Head renderer by adding this context parameter to their web.xml: <context-param> <param-name>org.icefaces.ace.theme</param-name> <param-value>none</param-value> </context-param> This won't load the theme and will load all plain HTML tags in <h:head> first (i.e. normal behaviour of <h:head>). Then, they could try to load a theme by using <h:outputStylesheet> or plain <link> tags.
          Hide
          Arturo Zambrano added a comment -

          From Deryk:

          I can't think of another workaround or fix offhand. Try what Art is suggesting I guess. If they aren't overriding anything they might be okay for now. Just to summarize (please correct where I've mistated):

          • IE doesn't like it if their special meta tag is not "first" in the head.
          • Our special head renderer is trying to ensure our various JS and CSS resources appear before any other resources to allow proper overriding.
          • There's no way for us to control the placement of the meta tag since it's not a head resource from JSFs point of view.

          I was wondering about the first point as I see in the ICEfaces 2 screenshot that it's after the title tag. So it doesn't exactly have to be first. According to http://msdn.microsoft.com/en-us/library/ie/cc288325(v=vs.85).aspx

          " The X-UA-Compatible header is not case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements."

          So any non-meta, non-title tag throws it off.

          Show
          Arturo Zambrano added a comment - From Deryk: I can't think of another workaround or fix offhand. Try what Art is suggesting I guess. If they aren't overriding anything they might be okay for now. Just to summarize (please correct where I've mistated): IE doesn't like it if their special meta tag is not "first" in the head. Our special head renderer is trying to ensure our various JS and CSS resources appear before any other resources to allow proper overriding. There's no way for us to control the placement of the meta tag since it's not a head resource from JSFs point of view. I was wondering about the first point as I see in the ICEfaces 2 screenshot that it's after the title tag. So it doesn't exactly have to be first. According to http://msdn.microsoft.com/en-us/library/ie/cc288325(v=vs.85).aspx " The X-UA-Compatible header is not case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements." So any non-meta, non-title tag throws it off.
          Hide
          Ken Fyten added a comment -

          With the removal of the custom HEAD renderer formerly used to inject the ACE themes automatically, this issue is now resolved.

          Resolving commit was:

          ICE-9274 Replaced HeadRenderer with system event listener that does the switching to the uncompressed versions of the ACE resources. The system event listener runs before the coalescing occurs, thus the coalescing will work with the uncompressed resources in development mode.

          Show
          Ken Fyten added a comment - With the removal of the custom HEAD renderer formerly used to inject the ACE themes automatically, this issue is now resolved. Resolving commit was: ICE-9274 Replaced HeadRenderer with system event listener that does the switching to the uncompressed versions of the ACE resources. The system event listener runs before the coalescing occurs, thus the coalescing will work with the uncompressed resources in development mode.

            People

            • Assignee:
              Ken Fyten
              Reporter:
              Arran Mccullough
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: