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

CSS percentage values are capped at 100%

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • 8, 11, 17, 21, 22
    • client-libs

      Most values where CSS allows percent are capped at 100% in Java CSS.

      For example, "width: 200%" and "width: 100%" are equal, which is incorrect.

      In Swing, when you load the provided HTML file into JEditorPane, all three <div> elements have the same width, and they fit inside the outer <div>.

      When viewed in a browser, the widths of the nested <div> elements are larger except for the last one with 'width: 100%'.


      This bug was found during code review for JDK-7083187:
      https://github.com/openjdk/jdk/pull/13405#discussion_r1222563667


      The CSS property 'overflow: visible' is not necessary, it is the default value of the property. If you change to 'overflow: hidden', the browser will render the HTML like Swing does.

        1. PercentCap.html
          0.4 kB
          Alexey Ivanov
        2. PercentCap.java
          1 kB
          Alexey Ivanov

            psadhukhan Prasanta Sadhukhan
            aivanov Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: