Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2507

When Zone is used within head element, it moves elements from head to body element

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 5.4
    • None
    • tapestry-core
    • None

    Description

      In our project we tried to surround the <title> element with a <t:zone>, in order to be able to refresh it via ajax.

      For a while, this seemed to work. However, a strange bug led us to discover what this caused behind the scenes: the <title> element, as well as all the <link> elements importing stylesheets (?!), were now being rendered as children of the <body> element instead of as children of the <head> element. This happened not only following a refresh of this zone, but even on initial render.

      The fact that the CSS links were moved by tapestry (not clear why - the zone only contained the title tag) was surprisingly well handled by browser (I never guessed that <title> and <link> elements would be "respected" by the browser even when they are in the document body rather than its head), but it had at least one annoying side-effect - the page began to render before the CSS was applied, which resulted in a strange flicker immediately following page load.

      We now realize that Zone cannot / should not be used within the head element, but the way we discovered this was too roundabout. I think the reasonable behavior should be either of the following:

      • Prevent Zone from being used inside the <head> element by throwing an appropriate exception on page load (this should also be stated in the documentation for the Zone component)

      or

      • Allow Zone to be used inside the <head> element, but don't move elements around the DOM tree - keep whatever's in the <head> element within the <head> element.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            annorax I D

            Dates

              Created:
              Updated:

              Slack

                Issue deployment