diff options
author | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-07-16 18:25:53 +0000 |
---|---|---|
committer | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-07-16 18:25:53 +0000 |
commit | c61e196ecfd1715f79f762f626dd70c7f557698e (patch) | |
tree | 26642ac3422d4ec6d902a94fc3f7df4da66df454 /gnu | |
parent | 3c698a346fb26c2efc814d25c9ae483da93d5b6f (diff) | |
download | classpath-c61e196ecfd1715f79f762f626dd70c7f557698e.tar.gz |
2006-07-16 Audrius Meskauskas <AudriusA@Bioinformatics.org>
PR 28392
* gnu/javax/swing/text/html/parser/htmlValidator.java
(tagIsValidForContext): If it is not possible to insert any tag, but
is possible to insert a P, insert a P.
* gnu/javax/swing/text/html/parser/HTML_401Swing.java
(newInstance): Removed print statement. (getBodyElements):
Removed ABBR, ACRONYM, BDO, Q, S, SUB, SUP and ADDRESS from the
valid body level tags (will be enclosed into P's).
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/javax/swing/text/html/parser/HTML_401Swing.java | 17 | ||||
-rw-r--r-- | gnu/javax/swing/text/html/parser/htmlValidator.java | 39 |
2 files changed, 22 insertions, 34 deletions
diff --git a/gnu/javax/swing/text/html/parser/HTML_401Swing.java b/gnu/javax/swing/text/html/parser/HTML_401Swing.java index 458dda493..9c934f647 100644 --- a/gnu/javax/swing/text/html/parser/HTML_401Swing.java +++ b/gnu/javax/swing/text/html/parser/HTML_401Swing.java @@ -38,9 +38,6 @@ exception statement from your version. */ package gnu.javax.swing.text.html.parser; -import java.io.IOException; - -import javax.swing.text.html.parser.ContentModel; import javax.swing.text.html.parser.DTD; /** @@ -64,7 +61,6 @@ public class HTML_401Swing extends HTML_401F */ public static DTD getInstance() { - System.out.println("HTML_401Swing.java.getInstance:"); return singleton; } @@ -78,15 +74,13 @@ public class HTML_401Swing extends HTML_401F protected String[] getBodyElements() { return new String[] { - ABBR, ACRONYM, - APPLET, BASEFONT, BDO, + APPLET, BASEFONT, BR, BUTTON, - FONT, IFRAME, IMG, + IFRAME, IMG, INPUT, LABEL, MAP, OBJECT, - Q, S, SCRIPT, SELECT, - SPAN, STRIKE, SUB, - SUP, TEXTAREA, - ADDRESS, BLOCKQUOTE, CENTER, DEL, DIR, + SCRIPT, SELECT, + TEXTAREA, + BLOCKQUOTE, CENTER, DEL, DIR, DIV, DL, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HR, INS, ISINDEX, MENU, NOFRAMES, @@ -94,5 +88,4 @@ public class HTML_401Swing extends HTML_401F UL }; } - } diff --git a/gnu/javax/swing/text/html/parser/htmlValidator.java b/gnu/javax/swing/text/html/parser/htmlValidator.java index 89a88794c..4d287a677 100644 --- a/gnu/javax/swing/text/html/parser/htmlValidator.java +++ b/gnu/javax/swing/text/html/parser/htmlValidator.java @@ -303,13 +303,12 @@ public abstract class htmlValidator } /** - * Check if this tag is valid for the current context. - * Return Boolean.True if it is OK, Boolean.False - * if it is surely not OK or the Element that the - * content model recommends to insert making the situation - * ok. If Boolean.True is returned, the content model current - * position is moved forward. Otherwise this position remains - * the same. + * Check if this tag is valid for the current context. Return Boolean.True if + * it is OK, Boolean.False if it is surely not OK or the Element that the + * content model recommends to insert making the situation ok. If Boolean.True + * is returned, the content model current position is moved forward. Otherwise + * this position remains the same. + * * @param tElement * @return */ @@ -333,30 +332,26 @@ public abstract class htmlValidator while (iter.hasPrevious()) { t = (hTag) iter.previous(); - if (!t.forcibly_closed) + if (! t.forcibly_closed) { - if (t.element.exclusions != null && - t.element.exclusions.get(idx) - ) + if (t.element.exclusions != null + && t.element.exclusions.get(idx)) return Boolean.FALSE; if (t.element.inclusions != null) inclusions.or(t.element.inclusions); } } - if (!inclusions.get(idx)) + if (! inclusions.get(idx)) { - // If we need to insert the text, and cannot do this, but - // it is allowed to insert the paragraph here, insert the + // If we need to insert something, and cannot do this, but + // it is allowed to insert the paragraph here, insert the // paragraph. - if (tElement.getElement().getName(). - equalsIgnoreCase(HTML_401F.PCDATA)) - { - Element P = dtd.getElement(HTML_401F.P); - if (inclusions.get(P.index)) - return P; - } - return Boolean.FALSE; + Element P = dtd.getElement(HTML_401F.P); + if (inclusions.get(P.index)) + return P; + else + return Boolean.FALSE; } } return Boolean.TRUE; |