-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b53
-
generic
-
generic
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Using Tiger [I used 1.5.0_01 but think that the most recent Tiger update release will behave the same way] we have the following document dump after copying and insertion "is the time" between two 'o' symbols in "good" using the code below:
********** The Document Dump *****************
<html
name=html
>
<head
name=head
>
<p-implied
name=p-implied
>
<content
name=content
CR=true
>
[0,1][
]
<body
name=body
>
<p-implied
name=p-implied
>
<content
name=content
>
[1,27][NOW is the time for all go]
<content
name=content
>
[27,28][
]
<p-implied
name=p-implied
>
<content
name=content
>
[28,39][is the time]
<content
name=content
CR=true
>
[39,40][
]
<p-implied
name=p-implied
>
<content
name=content
>
[40,49][od men TO]
<content
name=content
CR=true
>
[49,50][
]
<bidi root>
<bidi level
bidiLevel=0
>
[0,50][
NOW is the time for all go
is the time
...]
**********************************************
Using Mustang with the fix to Bug 4765288 integrated (see the webrev link in the Comments section for the corresponding webrev) we have the following _incorrect_ dump after the same actions:
********** The Document Dump *****************
<html
name=html
>
<head
name=head
>
<p-implied
name=p-implied
>
<content
name=content
CR=true
>
[0,1][
]
<body
name=body
>
<p-implied
name=p-implied
>
<content
name=content
>
[1,27][NOW is the time for all go]
<content
name=content
>
[27,28][
]
<content
name=content
>
[28,39][is the time]
<content
name=content
CR=true
>
[39,40][
]
<p-implied
name=p-implied
>
<content
name=content
>
[40,49][od men TO]
<content
name=content
CR=true
>
[49,50][
]
<bidi root>
<bidi level
bidiLevel=0
>
[0,50][
NOW is the time for all go
is the time
...]
**********************************************
Notice that the following 'content' elements are inserted directly into the 'body' element which is wrong:
<content
name=content
>
[28,39][is the time]
<content
name=content
CR=true
>
[39,40][
---------- BEGIN SOURCE ----------
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.text.AbstractDocument;
public class htmlcopytest
{
public static void main(String[] args)
{
final JEditorPane editorPane = new JEditorPane("text/html", "<html><body>NOW is the time for all good men TO</body></html>");
JFrame frame = new JFrame("A REGRESSION Bug by fix for Bug 4765288");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(editorPane, BorderLayout.CENTER);
JPanel buttonsPanel = new JPanel();
JButton dumpDocButton = new JButton("Dump Document");
dumpDocButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dumpDoc(editorPane);
}
});
buttonsPanel.add(dumpDocButton);
frame.getContentPane().add(buttonsPanel, BorderLayout.SOUTH);
frame.setSize(400, 300);
frame.setVisible(true);
}
private static void dumpDoc(JEditorPane editorPane) {
System.out.println();
System.out.println("********** The Document Dump *****************");
AbstractDocument ad = (AbstractDocument) editorPane.getDocument();
ad.dump(System.out);
System.out.println("**********************************************");
System.out.println();
}
}
---------- END SOURCE ----------
###@###.### 2005-05-30 15:42:18 GMT
Using Tiger [I used 1.5.0_01 but think that the most recent Tiger update release will behave the same way] we have the following document dump after copying and insertion "is the time" between two 'o' symbols in "good" using the code below:
********** The Document Dump *****************
<html
name=html
>
<head
name=head
>
<p-implied
name=p-implied
>
<content
name=content
CR=true
>
[0,1][
]
<body
name=body
>
<p-implied
name=p-implied
>
<content
name=content
>
[1,27][NOW is the time for all go]
<content
name=content
>
[27,28][
]
<p-implied
name=p-implied
>
<content
name=content
>
[28,39][is the time]
<content
name=content
CR=true
>
[39,40][
]
<p-implied
name=p-implied
>
<content
name=content
>
[40,49][od men TO]
<content
name=content
CR=true
>
[49,50][
]
<bidi root>
<bidi level
bidiLevel=0
>
[0,50][
NOW is the time for all go
is the time
...]
**********************************************
Using Mustang with the fix to Bug 4765288 integrated (see the webrev link in the Comments section for the corresponding webrev) we have the following _incorrect_ dump after the same actions:
********** The Document Dump *****************
<html
name=html
>
<head
name=head
>
<p-implied
name=p-implied
>
<content
name=content
CR=true
>
[0,1][
]
<body
name=body
>
<p-implied
name=p-implied
>
<content
name=content
>
[1,27][NOW is the time for all go]
<content
name=content
>
[27,28][
]
<content
name=content
>
[28,39][is the time]
<content
name=content
CR=true
>
[39,40][
]
<p-implied
name=p-implied
>
<content
name=content
>
[40,49][od men TO]
<content
name=content
CR=true
>
[49,50][
]
<bidi root>
<bidi level
bidiLevel=0
>
[0,50][
NOW is the time for all go
is the time
...]
**********************************************
Notice that the following 'content' elements are inserted directly into the 'body' element which is wrong:
<content
name=content
>
[28,39][is the time]
<content
name=content
CR=true
>
[39,40][
---------- BEGIN SOURCE ----------
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.text.AbstractDocument;
public class htmlcopytest
{
public static void main(String[] args)
{
final JEditorPane editorPane = new JEditorPane("text/html", "<html><body>NOW is the time for all good men TO</body></html>");
JFrame frame = new JFrame("A REGRESSION Bug by fix for Bug 4765288");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(editorPane, BorderLayout.CENTER);
JPanel buttonsPanel = new JPanel();
JButton dumpDocButton = new JButton("Dump Document");
dumpDocButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dumpDoc(editorPane);
}
});
buttonsPanel.add(dumpDocButton);
frame.getContentPane().add(buttonsPanel, BorderLayout.SOUTH);
frame.setSize(400, 300);
frame.setVisible(true);
}
private static void dumpDoc(JEditorPane editorPane) {
System.out.println();
System.out.println("********** The Document Dump *****************");
AbstractDocument ad = (AbstractDocument) editorPane.getDocument();
ad.dump(System.out);
System.out.println("**********************************************");
System.out.println();
}
}
---------- END SOURCE ----------
###@###.### 2005-05-30 15:42:18 GMT
- relates to
-
JDK-6409823 REGRESSION: Incorrectly inserted 'p-implied' in HTMLDocument
-
- Resolved
-
-
JDK-4765288 HTMLDocument inserts HTML with <BR> tag incorrectly
-
- Resolved
-
-
JDK-6217007 Copy from an HTML JEditorPane puts extra C/R on clipboard
-
- Closed
-