Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8288671

Problematic fix for font boosting

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 19
    • None
    • tools

    Backports

      Description

        JDK-8277420 included the addition to the stylesheet shown below to prevent font boosting aka text inflation in mobile browsers.

        /* Disable font boosting */
        h1, h2, h3, h4, h5, h6 {
            max-height: 2em;
        }

        This was necessary because otherwise the font size of headings would change depending on whether the copy-to-clipboard icon was visible or not.

        Unfortunately there are several issues with this change. While the definition of a `max-height` property for header elements prevents font-boosting, the value of 2em is too small for headers which require multiple line breaks. This can be seen in the attached screenshot where the header overlaps the following text.

        At the same time, font boosting is a problem that is not only present in header elements. In fact it is also visible in constructor and method signatures in member details and, less apparent, other parts of the generated documentation.

        Considering all of the above we should add a CSS declaration that applies to all elements with a `max-height` value that is beyond any reasonable value. It is unfortunate that the `max-height` hack is the only thing that works. There is a `text-size-adjust` CSS property proposed for this purpose as well as several browser-specific variants of it, but unfortunately it doesn't yet work for Chrome on Android which is the biggest offender.

        Attachments

          Issue Links

            Activity

              People

                hannesw Hannes Wallnoefer
                hannesw Hannes Wallnoefer
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: