Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.2.0, 5.1.0.5
    • Fix Version/s: 5.3, 5.2.5
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      According to the HTML5 Working Draft [1], the doctype to be used in the case you are using the HTML syntax is:

      <!DOCTYPE HTML> case-insensitive

      Unfortunately the class org.apache.tapestry5.dom.DTD doesn't allow doctypes with empty public and system identifier. It is also not possible to output the DOCTYPE legacy string <!DOCTYPE HTML SYSTEM "about:legacy-compat">, because some parser internal to Tapestry tries to resolve the system identifier. The best thing, I was able to output is the full HTML 4.01 strict doctype:

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

      It is allowed in HTML5 as obsolete permitted DOCTYPE string, but not desired.

      It would be very simple to allow for what empty HTML5 doctype in org.apache.tapestry5.dom.DTD.

      [1]: http://www.w3.org/TR/2010/WD-html5-20100304/

        Activity

        Alexander Kiel created issue -
        Hide
        Robin Komiwes added a comment -

        It seems that this issue is a duplicate of this one: https://issues.apache.org/jira/browse/TAP5-840

        Patch has been made, but unfortunately never reviewed

        Show
        Robin Komiwes added a comment - It seems that this issue is a duplicate of this one: https://issues.apache.org/jira/browse/TAP5-840 Patch has been made, but unfortunately never reviewed
        Hide
        Alexander Kiel added a comment -

        I don't think that https://issues.apache.org/jira/browse/TAP5-840 is exactly the same. It's more about the possibility to use named HTML character entities in Tapestry templates (*.tml) if you are using the HTML5 DOCTYPE in the template.

        But if you are using the HTML5 DOCTYPE in the template, it would not be output. I will submit a patch for this.

        Show
        Alexander Kiel added a comment - I don't think that https://issues.apache.org/jira/browse/TAP5-840 is exactly the same. It's more about the possibility to use named HTML character entities in Tapestry templates (*.tml) if you are using the HTML5 DOCTYPE in the template. But if you are using the HTML5 DOCTYPE in the template, it would not be output. I will submit a patch for this.
        Hide
        Alexander Kiel added a comment -

        Path against the trunk version of org.apache.tapestry5.dom.DTD. I simply added the ability to print DOCTYPEs without public or system identifiers.

        Show
        Alexander Kiel added a comment - Path against the trunk version of org.apache.tapestry5.dom.DTD. I simply added the ability to print DOCTYPEs without public or system identifiers.
        Alexander Kiel made changes -
        Field Original Value New Value
        Attachment added_ability_to_print_the_HTML5_DOCTYPE.patch [ 12437745 ]
        Hide
        Albert Tumanov added a comment -

        Thanks for the patch !

        I've done workaround by creating patched org.apache.tapestry5.dom.DTD class in my application.

        Show
        Albert Tumanov added a comment - Thanks for the patch ! I've done workaround by creating patched org.apache.tapestry5.dom.DTD class in my application.
        Hide
        Bob Harner added a comment - - edited

        Until this patch is applied, as a work-around you can emit the HTML5 doctype directly from your page (or layout) class, rather than your template, as described at http://tapestry.apache.org/component-templates.html (credit to Nille Hammer):

        /**

        I checked, and the attached patch still applies cleanly against the trunk and seems very low risk. Does somebody want to apply it?

        Show
        Bob Harner added a comment - - edited Until this patch is applied, as a work-around you can emit the HTML5 doctype directly from your page (or layout) class, rather than your template, as described at http://tapestry.apache.org/component-templates.html (credit to Nille Hammer): /** Output the HTML5 doctype, as a work-around to https://issues.apache.org/jira/browse/TAP5-1040 */ @SetupRender final void renderDocType(final MarkupWriter writer) { writer.getDocument().raw("<!DOCTYPE html>"); } I checked, and the attached patch still applies cleanly against the trunk and seems very low risk. Does somebody want to apply it?
        Josh Canfield made changes -
        Assignee Josh Canfield [ joshcanfield ]
        Hide
        Josh Canfield added a comment -

        Applied the patch and updated the unit tests.

        Show
        Josh Canfield added a comment - Applied the patch and updated the unit tests.
        Josh Canfield made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.3.0 [ 12316023 ]
        Fix Version/s 5.2.5 [ 12315565 ]
        Resolution Fixed [ 1 ]
        Josh Canfield made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        Hudson added a comment -

        Integrated in tapestry-5.2-freestyle #267 (See https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/267/)
        TAP5-1040 - integrated patch to allow no system or public id in doctype

        Show
        Hudson added a comment - Integrated in tapestry-5.2-freestyle #267 (See https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/267/ ) TAP5-1040 - integrated patch to allow no system or public id in doctype
        Howard M. Lewis Ship made changes -
        Fix Version/s 5.3 [ 12316024 ]
        Fix Version/s 5.3.0 [ 12316023 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        355d 5h 35m 1 Josh Canfield 21/Feb/11 20:20
        Resolved Resolved Closed Closed
        9s 1 Josh Canfield 21/Feb/11 20:20

          People

          • Assignee:
            Josh Canfield
            Reporter:
            Alexander Kiel
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development