Re: [Fwd: Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions]

2006-04-25 Thread Audrius Meskauskas

If you run http://www.geocities.com/SiliconValley/Park/9967/atari.html
in the standalone (using gcjappletviewer), you will notice one of the
applets is not loaded. The problem is the codebase for the applet is
being parsed to http: instead of the entire url.

Hello, Lillian,

I did not expected that the unquoted parameter value may contain slash. 
This is simple to fix. As far as I checked there are no regressions from 
this change, let me known if they are.


2006-04-25  Audrius Meskauskas  [EMAIL PROTECTED]

   * gnu/javax/swing/text/html/parser/support/Parser.java (readAttributes):
   Allow slashes (/) in the unquoted parameter value.

Index: Parser.java
===
RCS file: /sources/classpath/classpath/gnu/javax/swing/text/html/parser/support/Parser.java,v
retrieving revision 1.3
diff -u -r1.3 Parser.java
--- Parser.java	2 Jul 2005 20:32:15 -	1.3
+++ Parser.java	25 Apr 2006 14:51:22 -
@@ -978,8 +978,23 @@
   error(The value without opening quote is closed with ' +
 next.getImage() + '
);
+  attrValue = value.getImage();
 }
-  attrValue = value.getImage();
+  else if (next.kind == SLASH)
+// The slash in this context is treated as the ordinary
+// character, not as a token. The slash may be part of
+// the unquoted URL.
+{
+  StringBuffer image = new StringBuffer(value.getImage());
+  while (next.kind == NUMTOKEN || next.kind == SLASH)
+{
+  image.append(getNextToken().getImage());
+  next = getTokenAhead();
+}
+  attrValue = image.toString();
+}
+  else
+attrValue = value.getImage();
   break;
 
 default :


Re: [Fwd: Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions]

2006-04-25 Thread Lillian Angel
On Tue, 2006-04-25 at 16:57 +0200, Audrius Meskauskas wrote:
 If you run http://www.geocities.com/SiliconValley/Park/9967/atari.html
 in the standalone (using gcjappletviewer), you will notice one of the
 applets is not loaded. The problem is the codebase for the applet is
 being parsed to http: instead of the entire url.
 
 Hello, Lillian,
 
 I did not expected that the unquoted parameter value may contain slash. 
 This is simple to fix. As far as I checked there are no regressions from 
 this change, let me known if they are.

So far I don't see any regressions. Thank you for fixing this. :)

 
 2006-04-25  Audrius Meskauskas  [EMAIL PROTECTED]
 
 * gnu/javax/swing/text/html/parser/support/Parser.java (readAttributes):
 Allow slashes (/) in the unquoted parameter value.
 




Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions

2006-04-19 Thread Chris Burdess

Lillian Angel wrote:

That's wrong. The colon is not permitted to appear as the last
character in the string. You removed a valid check.


Sun does permit a ':' to be the last character in a string.


I was rather quick to assume that I was correct. I retested the  
applets

that posed to be a problem, and they now work with this part of the
patch reverted.

2006-04-18  Lillian Angel  [EMAIL PROTECTED]

* gnu/xml/dom/DomDocument.java
(checkNCName): Reverted last patch. Added check for colon at
last position back in.


Thanks for pointing this out, I have changed it back.


FYI

http://www.w3.org/TR/REC-xml-names/#ns-qualnames
http://www.w3.org/TR/xml-names11/#ns-qualnames
--
犬 Chris Burdess
  They that can give up essential liberty to obtain a little safety
  deserve neither liberty nor safety. - Benjamin Franklin






PGP.sig
Description: This is a digitally signed message part


Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions

2006-04-18 Thread Lillian Angel
On Mon, 2006-04-17 at 09:11 +0100, Chris Burdess wrote:
 Lillian Angel wrote:
  More bug fixes for the parser and related classes.
 
  2006-04-12  Lillian Angel  [EMAIL PROTECTED]
 
  * gnu/xml/dom/DomDocument.java
  (checkNCName): Removed unneeded part of check.
 
 Hi Lillian,
 
 --- gnu/xml/dom/DomDocument.java  12 Jan 2006 16:35:52 -  1.8
 +++ gnu/xml/dom/DomDocument.java  12 Apr 2006 16:04:42 -
 @@ -535,8 +535,7 @@
   int index = name.indexOf(':');
   if (index != -1)
 {
 -if (index == 0 || index == (len - 1) ||
 -name.lastIndexOf(':') != index)
 +if (index == 0 || name.lastIndexOf(':') != index)
 {
   throw new DomDOMException(DOMException.NAMESPACE_ERR,
 name, null, 0);
 
 That's wrong. The colon is not permitted to appear as the last  
 character in the string. You removed a valid check.

Sun does permit a ':' to be the last character in a string.

Lillian




Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions

2006-04-18 Thread Lillian Angel
On Tue, 2006-04-18 at 17:13 -0400, Lillian Angel wrote:
 On Mon, 2006-04-17 at 09:11 +0100, Chris Burdess wrote:
  Lillian Angel wrote:
   More bug fixes for the parser and related classes.
  
   2006-04-12  Lillian Angel  [EMAIL PROTECTED]
  
   * gnu/xml/dom/DomDocument.java
   (checkNCName): Removed unneeded part of check.
  
  Hi Lillian,
  
  --- gnu/xml/dom/DomDocument.java12 Jan 2006 16:35:52 -  1.8
  +++ gnu/xml/dom/DomDocument.java12 Apr 2006 16:04:42 -
  @@ -535,8 +535,7 @@
int index = name.indexOf(':');
if (index != -1)
  {
  -if (index == 0 || index == (len - 1) ||
  -name.lastIndexOf(':') != index)
  +if (index == 0 || name.lastIndexOf(':') != index)
  {
throw new DomDOMException(DOMException.NAMESPACE_ERR,
  name, null, 0);
  
  That's wrong. The colon is not permitted to appear as the last  
  character in the string. You removed a valid check.
 
 Sun does permit a ':' to be the last character in a string.
 

I was rather quick to assume that I was correct. I retested the applets
that posed to be a problem, and they now work with this part of the
patch reverted.

2006-04-18  Lillian Angel  [EMAIL PROTECTED]

* gnu/xml/dom/DomDocument.java
(checkNCName): Reverted last patch. Added check for colon at
last position back in.


Thanks for pointing this out, I have changed it back.
Lillian
? lib/classes.2
Index: gnu/xml/dom/DomDocument.java
===
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomDocument.java,v
retrieving revision 1.9
diff -u -r1.9 DomDocument.java
--- gnu/xml/dom/DomDocument.java	12 Apr 2006 16:10:25 -	1.9
+++ gnu/xml/dom/DomDocument.java	18 Apr 2006 21:23:12 -
@@ -535,10 +535,9 @@
 int index = name.indexOf(':');
 if (index != -1)
   {
-if (index == 0 || name.lastIndexOf(':') != index)
+if (index == 0 || index == (len - 1) || name.lastIndexOf(':') != index)
   {
-throw new DomDOMException(DOMException.NAMESPACE_ERR,
-  name, null, 0);
+throw new DomDOMException(DOMException.NAMESPACE_ERR, name, null, 0);
   }
   }
   }


Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions

2006-04-17 Thread Chris Burdess

Lillian Angel wrote:

More bug fixes for the parser and related classes.

2006-04-12  Lillian Angel  [EMAIL PROTECTED]

* gnu/xml/dom/DomDocument.java
(checkNCName): Removed unneeded part of check.


Hi Lillian,

--- gnu/xml/dom/DomDocument.java12 Jan 2006 16:35:52 -  1.8
+++ gnu/xml/dom/DomDocument.java12 Apr 2006 16:04:42 -
@@ -535,8 +535,7 @@
 int index = name.indexOf(':');
 if (index != -1)
   {
-if (index == 0 || index == (len - 1) ||
-name.lastIndexOf(':') != index)
+if (index == 0 || name.lastIndexOf(':') != index)
   {
 throw new DomDOMException(DOMException.NAMESPACE_ERR,
   name, null, 0);

That's wrong. The colon is not permitted to appear as the last  
character in the string. You removed a valid check.

--
犬 Chris Burdess
  They that can give up essential liberty to obtain a little safety
  deserve neither liberty nor safety. - Benjamin Franklin






PGP.sig
Description: This is a digitally signed message part


Re: [cp-patches] FYI: gnu.xml.dom.html2.* fixes and additions

2006-04-12 Thread Lillian Angel
More bug fixes for the parser and related classes.

2006-04-12  Lillian Angel  [EMAIL PROTECTED]

* gnu/xml/dom/DomDocument.java
(checkNCName): Removed unneeded part of check.
* gnu/xml/dom/DomNode.java
(dispatchEvent): Added code to grow ancestors array
if needed. Changed checks to use depth of node instead.
Fixes an infinite loop and segmentation fault.
* gnu/xml/dom/html2/DomHTMLParser.java
(handleEndTag): No need to use/make a copy of the node.
Causes an infinite loop.



On Tue, 2006-04-11 at 14:07 -0400, Lillian Angel wrote:
 I have changed gcjwebplugin to use the parser in 
 gnu/xml/dom/html2/*.
 
 I added some needed functions/classes. Also, fixed a few minor bugs in
 the parser and awt.
 
 2006-04-11  Lillian Angel  [EMAIL PROTECTED]
 
 * gnu/xml/dom/DomNodeIterator.java
 (nextNode): Moved line of code to avoid an infinite loop.
 * gnu/xml/dom/html2/DomHTMLAppletElement.java
 (getCls): New function.
 (setCls): Likewise.
 (getSrc): Likewise.
 (setSrc): Likewise.
 * gnu/xml/dom/html2/DomHTMLDocument.java:
 Added DomHTMLEmbedElement to map.
 (getApplets): Added node name, 'embed'.
 * gnu/xml/dom/html2/DomHTMLEmbedElement.java:
 New class.
 * gnu/xml/dom/html2/DomHTMLObjectElement.java
 (getJavaCode): New function.
 (setJavaCode): Likewise.
 (getObject): Likewise.
 (setObject): Likewise.
 (getJavaObject): Likewise.
 (setJavaObject): Likewise.
 (getJavaArchive): Likewise.
 (setJavaArchive): Likewise.
 (getJavaCodeBase): Likewise.
 (setJavaCodeBase): Likewise.
 (getJavaType): Likewise.
 (setJavaType): Likewise.
 (setMayscript): Likewise.
 (getMayscript): Likewise.
 (setScriptable): Likewise.
 (getScriptable): Likewise.
 * gnu/xml/dom/html2/DomHTMLParser.java
 (parseDocument): Should not check for well formedness
 when parsing an html document.
 * java/awt/Window.java
 (dispatchEvent): Added check to avoid NPE.
 
Index: gnu/xml/dom/DomDocument.java
===
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomDocument.java,v
retrieving revision 1.8
diff -u -r1.8 DomDocument.java
--- gnu/xml/dom/DomDocument.java	12 Jan 2006 16:35:52 -	1.8
+++ gnu/xml/dom/DomDocument.java	12 Apr 2006 16:04:42 -
@@ -535,8 +535,7 @@
 int index = name.indexOf(':');
 if (index != -1)
   {
-if (index == 0 || index == (len - 1) ||
-name.lastIndexOf(':') != index)
+if (index == 0 || name.lastIndexOf(':') != index)
   {
 throw new DomDOMException(DOMException.NAMESPACE_ERR,
   name, null, 0);
Index: gnu/xml/dom/DomNode.java
===
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/DomNode.java,v
retrieving revision 1.13
diff -u -r1.13 DomNode.java
--- gnu/xml/dom/DomNode.java	12 Jan 2006 19:46:59 -	1.13
+++ gnu/xml/dom/DomNode.java	12 Apr 2006 16:04:42 -
@@ -1120,7 +1120,6 @@
 node.appendChild(newChild);
   }
   }
-
 if (nodeType == ENTITY_REFERENCE_NODE)
   {
 node.makeReadonly();
@@ -1556,23 +1555,30 @@
 ancestorLen = ancestors.length;
   }
 
-// XXX autogrow ancestors ... based on statistics
-
 // Climb to the top of this subtree and handle capture, letting
 // each node (from the top down) capture until one stops it or
 // until we get to this one.
-
-for (index = 0, current = parent;
- current != null  index  ancestorLen;
- index++, current = current.parent)
+current = parent;
+if (current.depth = ANCESTORS_INIT)
+  {
+DomNode[] newants = new DomNode[current.depth + 1];
+System.arraycopy(ancestors, 0, newants, 0, ancestors.length);
+ancestors = newants;
+ancestorLen = ancestors.length;
+  }
+for (index = 0; index  ancestorLen; index++)
   {
+if (current == null || current.depth == 0)
+  break;
+
 if (current.nListeners != 0)
   {
 haveAncestorRegistrations = true;
   }
 ancestors [index] = current;
+current = current.parent;
   }
-if (current != null)
+if (current.depth  0)
   {
 throw new RuntimeException(dispatchEvent capture stack size);
   }
Index: gnu/xml/dom/html2/DomHTMLParser.java
===
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/html2/DomHTMLParser.java,v
retrieving revision 1.4