summaryrefslogtreecommitdiff
path: root/javax/swing/text/html
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2006-11-15 13:35:05 +0000
committerRoman Kennke <roman@kennke.org>2006-11-15 13:35:05 +0000
commitef0ba6a7f0fb1697c58c9db0272b279b9b3233b1 (patch)
treeae6d74eac614a2f8c1b0473364d132d4a3790f43 /javax/swing/text/html
parentd75e6f110b4e554532133d265beffd0ff211fd38 (diff)
downloadclasspath-ef0ba6a7f0fb1697c58c9db0272b279b9b3233b1.tar.gz
2006-11-15 Roman Kennke <kennke@aicas.com>
* javax/swing/text/html/HTMLDocument.java (HTMLReader.ParagraphAction.end): Call super instead of blockClose() directly. (HTMLReader.ParagraphAction.start): Call super instead of blockOpen() directly. (HTMLReader.parseStack): Removed. (HTMLReader.blockClose): Simply call addContent() with ' ' instead of doing more complicated stuff. Removed parseStack handling. (HTMLReader.blockOpen): Removed parseStack handling. (getInsertingReader): Removed parseStack init. * gnu/javax/swing/text/html/parser/htmlValidator.java (closeTag): Return true only when the tag actually should be closed. * gnu/javax/swing/text/html/parser/support/Parser.java (_handleEndTag): Only actually close the tag when the validator allows it.
Diffstat (limited to 'javax/swing/text/html')
-rw-r--r--javax/swing/text/html/HTMLDocument.java26
1 files changed, 3 insertions, 23 deletions
diff --git a/javax/swing/text/html/HTMLDocument.java b/javax/swing/text/html/HTMLDocument.java
index 418607309..bbc2368c3 100644
--- a/javax/swing/text/html/HTMLDocument.java
+++ b/javax/swing/text/html/HTMLDocument.java
@@ -523,12 +523,6 @@ public class HTMLDocument extends DefaultStyledDocument
* A stack for character attribute sets *
*/
Stack charAttrStack = new Stack();
-
- /**
- * The parse stack. This stack holds HTML.Tag objects that reflect the
- * current position in the parsing process.
- */
- Stack parseStack = new Stack();
/** A mapping between HTML.Tag objects and the actions that handle them **/
HashMap tagToAction;
@@ -816,7 +810,7 @@ public class HTMLDocument extends DefaultStyledDocument
*/
public void start(HTML.Tag t, MutableAttributeSet a)
{
- blockOpen(t, a);
+ super.start(t, a);
inParagraph = true;
}
@@ -826,7 +820,7 @@ public class HTMLDocument extends DefaultStyledDocument
*/
public void end(HTML.Tag t)
{
- blockClose(t);
+ super.end(t);
inParagraph = false;
}
}
@@ -1512,7 +1506,6 @@ public class HTMLDocument extends DefaultStyledDocument
DefaultStyledDocument.ElementSpec element;
- parseStack.push(t);
AbstractDocument.AttributeContext ctx = getAttributeContext();
AttributeSet copy = attr.copyAttributes();
copy = ctx.addAttribute(copy, StyleConstants.NameAttribute, t);
@@ -1546,21 +1539,12 @@ public class HTMLDocument extends DefaultStyledDocument
parseBuffer.get(parseBuffer.size() - 1);
if (prev.getType() == DefaultStyledDocument.ElementSpec.StartTagType)
{
- AbstractDocument.AttributeContext ctx = getAttributeContext();
- AttributeSet attributes = ctx.getEmptySet();
- attributes = ctx.addAttribute(attributes, StyleConstants.NameAttribute,
- HTML.Tag.CONTENT);
- element = new DefaultStyledDocument.ElementSpec(attributes,
- DefaultStyledDocument.ElementSpec.ContentType,
- new char[0], 0, 0);
- parseBuffer.add(element);
+ addContent(new char[]{' '}, 0, 1);
}
element = new DefaultStyledDocument.ElementSpec(null,
DefaultStyledDocument.ElementSpec.EndTagType);
parseBuffer.addElement(element);
- if (parseStack.size() > 0)
- parseStack.pop();
}
/**
@@ -1734,10 +1718,6 @@ public class HTMLDocument extends DefaultStyledDocument
}
};
- // Set the parent HTML tag.
- reader.parseStack.push(parent.getAttributes().getAttribute(
- StyleConstants.NameAttribute));
-
return reader;
}