Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5335

All Hudson pages are served without <!DOCTYPE HTML>

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • None
    • None
    • Windows 7 Ultimate 64bit, Java 1.6.0_17 64bit, Hudson 1.341

      All pages served by Hudson (running with java -jar hudson.war, so self-hosting with Winstone if I understand correctly) lack any DOCTYPE, which means browsers (both Firefox and Internet Explorer at least) use their "quirks" rendering mode.

      At least with IE (8 in my case), this causes layout problems with some pages; e.g. the Hudson plugins page doesn't wrap the descriptions, giving a horizontal scrollbar only in quirks (IE5) mode (both IE7 and IE8 modes wrap fine).

      Just prefixing the HTML in the document with "<!DOCTYPE HTML>" (as defined in HTML5) is enough to switch both Firefox and IE to their newest and best parsing and rendering modes, and will continue to do so going forward.

          [JENKINS-5335] All Hudson pages are served without <!DOCTYPE HTML>

          jlpinardon added a comment -

          This problem has come to me when I tried to use the Simple Theme Plugin.
          It was impossible to add a custom css with a :after or :before pseudo class content, rendered on Firefox, Chrome (OK) and IE8 (NOK).
          After some trials, it appears that IE8.0 can render :before if the doctype line is present.

          So, this problem is really annoying for support team managing several instances for different clients. For both user experience and security (avoid to make changes on an unwished instance when several are opened on a browser), customizing even slightly (header, logo) the interface can be a real need.

          jlpinardon added a comment - This problem has come to me when I tried to use the Simple Theme Plugin. It was impossible to add a custom css with a :after or :before pseudo class content, rendered on Firefox, Chrome (OK) and IE8 (NOK). After some trials, it appears that IE8.0 can render :before if the doctype line is present. So, this problem is really annoying for support team managing several instances for different clients. For both user experience and security (avoid to make changes on an unwished instance when several are opened on a browser), customizing even slightly (header, logo) the interface can be a real need.

          Julien HENRY added a comment -

          I tried to fix this issue by editing core/src/main/resources/lib/layout/layout.jelly.

          Juste add

          xmlns:x="jelly:xml"
          

          in the first j:jelly tag. Then add

          <x:doctype name="html"/>

          just before the

          <html>

          tag.

          I will try to propose a pull request if time permit.

          I did some tests and for now everything is fine.

          Julien HENRY added a comment - I tried to fix this issue by editing core/src/main/resources/lib/layout/layout.jelly. Juste add xmlns:x= "jelly:xml" in the first j:jelly tag. Then add <x:doctype name= "html" /> just before the <html> tag. I will try to propose a pull request if time permit. I did some tests and for now everything is fine.

          Code changed in jenkins
          User: Seiji Sogabe
          Path:
          core/src/main/resources/lib/layout/layout.jelly
          http://jenkins-ci.org/commit/jenkins/4266fc62ddbb1202d9f24df19a1be511e868225e
          Log:
          Merge pull request #260 from henryju/JENKINS-5335-doctype

          JENKINS-5335 Add html doctype on Jenkins to avoid quirks mode.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Seiji Sogabe Path: core/src/main/resources/lib/layout/layout.jelly http://jenkins-ci.org/commit/jenkins/4266fc62ddbb1202d9f24df19a1be511e868225e Log: Merge pull request #260 from henryju/ JENKINS-5335 -doctype JENKINS-5335 Add html doctype on Jenkins to avoid quirks mode.

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          core/src/main/resources/lib/layout/layout.jelly
          http://jenkins-ci.org/commit/jenkins/cf2a725ca1305ca1f238b328f7db70d2cd9dfe30
          Log:
          JENKINS-5335 set chrome frame META for better user experience even on Internet Explorer

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: core/src/main/resources/lib/layout/layout.jelly http://jenkins-ci.org/commit/jenkins/cf2a725ca1305ca1f238b328f7db70d2cd9dfe30 Log: JENKINS-5335 set chrome frame META for better user experience even on Internet Explorer

          I also added Chrome Frame META header for better user experience on Internet Explorer

          Nicolas De Loof added a comment - I also added Chrome Frame META header for better user experience on Internet Explorer

          jieryn added a comment -

          While I do love Google Chrome Frame, I think this is not so good. There's already a Google Chrome Frame plugin which allows customization of this. Blanket setting of this setting via chrome=1 may not be desirable.

          https://wiki.jenkins-ci.org/display/JENKINS/Chrome+Frame+Plugin

          jieryn added a comment - While I do love Google Chrome Frame, I think this is not so good. There's already a Google Chrome Frame plugin which allows customization of this. Blanket setting of this setting via chrome=1 may not be desirable. https://wiki.jenkins-ci.org/display/JENKINS/Chrome+Frame+Plugin

          James Ross added a comment -

          This issue was only about the doctype, which vastly improves the experience in IE on some pages as it is; other issues with Jenkins in IE should be fixed properly for all IE users and not wallpapered over for the tiny fraction of the IE userbase that have Chrome Frame installed.

          James Ross added a comment - This issue was only about the doctype, which vastly improves the experience in IE on some pages as it is; other issues with Jenkins in IE should be fixed properly for all IE users and not wallpapered over for the tiny fraction of the IE userbase that have Chrome Frame installed.

          dogfood added a comment -

          dogfood added a comment - Integrated in jenkins_main_trunk #1170

          jieryn added a comment -

          jieryn added a comment - https://github.com/jenkinsci/jenkins/pull/262

          jieryn added a comment -

          The original problem has been resolved, long ago. Resolving as fixed.

          jieryn added a comment - The original problem has been resolved, long ago. Resolving as fixed.

            Unassigned Unassigned
            twpol James Ross
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: