harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r568934 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/text/html/HTMLDocument.java test/api/java.injected/javax/swing/text/html/HTMLDocument_Reader_ActionsTest.java
Date Thu, 23 Aug 2007 11:20:25 GMT
Author: apetrenko
Date: Thu Aug 23 04:20:25 2007
New Revision: 568934

URL: http://svn.apache.org/viewvc?rev=568934&view=rev
Log:
Patch for HARMONY-4574 "[classlib][swing][html] Blank link text is rendered as underscore"

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/text/html/HTMLDocument_Reader_ActionsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java?rev=568934&r1=568933&r2=568934&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java
Thu Aug 23 04:20:25 2007
@@ -364,14 +364,11 @@
             public void start(final Tag tag, final MutableAttributeSet attr) {
                 super.start(tag, attr);
                 openedBlocks.add(Tag.A);
-                anchorTextEncountered = false;
             }
             
             public void end(final Tag tag) {
-                if (openedBlocks.contains(Tag.A) && !anchorTextEncountered) {
-                    addContent(new char[] {' '}, 0, 1);
-                    anchorTextEncountered = true;
-                }
+                // According to H4574 Empty AncorTextEncoured verification has
+                // been removed
                 super.end(tag);
                 openedBlocks.remove(Tag.A);
             }
@@ -553,7 +550,6 @@
         private final Set openedBlocks = new HashSet();
         private boolean impliedBlockOpen;
         private int numBlocksOpen;
-        private boolean anchorTextEncountered;
 
         private boolean needImpliedNewLine;
         private String styleRule;
@@ -628,9 +624,6 @@
         }
 
         public void handleText(final char[] data, final int pos) {
-            if (openedBlocks.contains(Tag.A)) {
-                anchorTextEncountered = true;
-            }
             if (openedBlocks.contains(Tag.TITLE)) {
                 putProperty(TitleProperty, new String(data));
                 return;

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/text/html/HTMLDocument_Reader_ActionsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/text/html/HTMLDocument_Reader_ActionsTest.java?rev=568934&r1=568933&r2=568934&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/text/html/HTMLDocument_Reader_ActionsTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/text/html/HTMLDocument_Reader_ActionsTest.java
Thu Aug 23 04:20:25 2007
@@ -248,9 +248,9 @@
         assertEquals(0, reader.parseBuffer.size());
         reader.handleEndTag(tag, 0);
         assertEquals(0, reader.charAttr.getAttributeCount());
-        assertEquals(2, reader.parseBuffer.size());
-        assertSpec((ElementSpec)reader.parseBuffer.get(0), ElementSpec.StartTagType, ElementSpec.OriginateDirection,
0, null);
-        checkImplicitContentSpec((ElementSpec)reader.parseBuffer.get(1));
+        // The rest part of the test is deleted because according to H-4574
+        // there is no underscore added if no text encountered. all the
+        // verification in that part occurs in the testAnchorStartTextEnd        
     }
 
     public void testAnchorStartTextEnd() {



Mime
View raw message