JDK-5088268 : REGRESSION: Suns Default CSS has bad styles for lists
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000,windows_xp
  • CPU: generic,x86
  • Submitted: 2004-08-17
  • Updated: 2004-10-25
  • Resolved: 2004-09-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
5.0u1 betaFixed 6Fixed
Related Reports
Duplicate :  
Description
Name: rmT116609			Date: 08/17/2004


FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
Suns Default CSS has bad styles for lists.

I traced the cause of the problem to Suns default.css.
It has been written as though margins are inheritted when in fact they are not.
The right margin is set to 50 on ul and never reset to 0 on nested uls.
This causes the margins to be an upside down pyramid shape, instead of the desired rectangular shape.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the test case.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
to see 4 rows of *'s
ACTUAL -
the 1st 2 rows are fine the next is split into 2, the last is shown vertically instead of horizontally

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;

public class Test {
  public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(new JEditorPane("text/html",
      "<HTML>" +
        "<BODY>" +
          "<UL>" +
            "<LI>* * * * * * * * * *" +
              "<UL>" +
                "<LI>* * * * * * * * * *" +
                  "<UL>" +
                    "<LI>* * * * * * * * * *</LI>" +
                      "<UL>" +
                        "<LI>* * * * * * * * * *</LI>" +
                      "</UL>" +
                    "</LI>" +
                  "</UL>" +
                "</LI>" +
              "</UL>" +
            "</LI>" +
          "</UL>" +
        "</BODY>" +
      "</HTML>"));
    frame.setSize(300, 500);
    frame.setVisible(true);
  }
}


---------- END SOURCE ----------

Release Regression From : 1.4.2_05
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Incident Review ID: 297293) 
======================================================================
###@###.### 10/25/04 19:24 GMT

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.5.0_01 mustang FIXED IN: 1.5.0_01 mustang INTEGRATED IN: 1.5.0_01 mustang
28-09-2004

EVALUATION will work on this bug for the next release ###@###.### 2004-08-18 this bug is a regression introduced by the fix for 4803145 simple fix could be to undo changes from 4803145 *** /tmp/geta25977 Tue Aug 31 21:16:58 2004 --- default.css Tue Aug 31 21:09:22 2004 *************** *** 98,104 **** margin-top: 10; margin-bottom: 10; margin-left: 50; - margin-right: 50; list-style-type: decimal } --- 98,103 ---- *************** *** 113,119 **** ul {margin-top: 10; margin-bottom: 10; margin-left: 50; - margin-right: 50; list-style-type: disc; -bullet-gap: 10} --- 112,117 ---- ###@###.### 2004-08-31 I suggest to introduce new css attributes for orientation aware tags [ <dir>, <meny>, <ul>, <ol> ] left-margin-ltr, left-margin-rtl, right-margin-ltr and right-margin-rtl. *-ltr margins are to be used if current orientation is left-to-right *-rtl margins are to be used if current orientation is right-to-left left-margin and right-margin overrides new attributes for backward compatibility. changes to default.css === *** /tmp/geta11471 Fri Sep 10 11:28:31 2004 --- default.css Thu Sep 9 22:56:33 2004 *************** *** 57,63 **** margin-top: 0; margin-bottom: 0} ! menu {margin-left: 40; margin-top: 10; margin-bottom: 10} --- 57,64 ---- margin-top: 0; margin-bottom: 0} ! menu {margin-left-ltr: 40; ! margin-right-rtl: 40; margin-top: 10; margin-bottom: 10} *************** *** 69,79 **** margin-top: 0; margin-bottom: 0} ! dir {margin-left: 40; margin-top: 10; margin-bottom: 10} ! dd {margin-left: 40; margin-top: 0; margin-bottom: 0} --- 70,82 ---- margin-top: 0; margin-bottom: 0} ! dir {margin-left-ltr: 40; ! margin-right-rtl: 40; margin-top: 10; margin-bottom: 10} ! dd {margin-left-ltr: 40; ! margin-right-rtl: 40; margin-top: 0; margin-bottom: 0} *************** *** 97,104 **** ol { margin-top: 10; margin-bottom: 10; ! margin-left: 50; ! margin-right: 50; list-style-type: decimal } --- 100,107 ---- ol { margin-top: 10; margin-bottom: 10; ! margin-left-ltr: 50; ! margin-right-rtl: 50; list-style-type: decimal } *************** *** 112,119 **** ul {margin-top: 10; margin-bottom: 10; ! margin-left: 50; ! margin-right: 50; list-style-type: disc; -bullet-gap: 10} --- 115,122 ---- ul {margin-top: 10; margin-bottom: 10; ! margin-left-ltr: 50; ! margin-right-rtl: 50; list-style-type: disc; -bullet-gap: 10} *************** *** 123,129 **** margin-bottom: 0} ul li ul {list-style-type: circle; ! margin-left: 25} ul li ul li ul li {margin-left: 0; margin-right: 0; --- 126,133 ---- margin-bottom: 0} ul li ul {list-style-type: circle; ! margin-left-ltr: 25; ! margin-right-rtl: 25;} ul li ul li ul li {margin-left: 0; margin-right: 0; *************** *** 131,140 **** margin-bottom: 0} ul li ul li ul {list-style-type: square; ! margin-left: 25} ul li menu {list-style-type: circle; ! margin-left: 25} ul li p {margin-top: 0; margin-bottom:0} --- 135,146 ---- margin-bottom: 0} ul li ul li ul {list-style-type: square; ! margin-left-ltr: 25; ! margin-right-rtl: 25} ul li menu {list-style-type: circle; ! margin-left-ltr: 25; ! margin-right-rtl: 25;} ul li p {margin-top: 0; margin-bottom:0} === Also CSS.java and StyleSheet.java is to be altered to start using thous attribute ###@###.### 2004-09-10
10-09-2004