mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-12 00:43:14 +00:00
8150225: api/javax_swing/text/AbstractWriter/index_indent failed
Reviewed-by: serb, aniyogi
This commit is contained in:
parent
03bb7d11b7
commit
dc8fa87bb6
@ -441,7 +441,7 @@ public abstract class AbstractWriter {
|
||||
--offsetIndent;
|
||||
}
|
||||
else {
|
||||
indentLevel = indentLevel > 0 ? indentLevel-- : 0;
|
||||
indentLevel--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -178,7 +178,8 @@ public class HTMLWriter extends AbstractWriter {
|
||||
if (!synthesizedElement(top)) {
|
||||
AttributeSet attrs = top.getAttributes();
|
||||
if (!matchNameAttribute(attrs, HTML.Tag.PRE) &&
|
||||
!isFormElementWithContent(attrs)) {
|
||||
!isFormElementWithContent(attrs) &&
|
||||
!isPreTagWithParagraphTag(attrs)) {
|
||||
decrIndent();
|
||||
}
|
||||
endTag(top);
|
||||
@ -223,7 +224,8 @@ public class HTMLWriter extends AbstractWriter {
|
||||
if (!synthesizedElement(current)) {
|
||||
AttributeSet attrs = current.getAttributes();
|
||||
if (!matchNameAttribute(attrs, HTML.Tag.PRE) &&
|
||||
!isFormElementWithContent(attrs)) {
|
||||
!isFormElementWithContent(attrs) &&
|
||||
!isPreTagWithParagraphTag(attrs)) {
|
||||
decrIndent();
|
||||
}
|
||||
endTag(current);
|
||||
@ -830,6 +832,14 @@ public class HTMLWriter extends AbstractWriter {
|
||||
matchNameAttribute(attr, HTML.Tag.SELECT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the element associated with the attributeset
|
||||
* is a P tag and it is within Pre tag. If true, returns true else
|
||||
* false
|
||||
*/
|
||||
private boolean isPreTagWithParagraphTag(AttributeSet attr) {
|
||||
return inPre && matchNameAttribute(attr, HTML.Tag.P);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether a the indentation needs to be
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 7104635
|
||||
* @bug 7104635 8150225
|
||||
* @summary HTMLEditorKit fails to write down some html files
|
||||
* @run main HTMLEditorKitWriterBug
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user