2002/css-validator/html/tags BaseTag.java,1.2,1.3 ParserFrame.java,1.2,1.3 StyleTag.java,1.3,1.4

Update of /sources/public/2002/css-validator/html/tags
In directory hutz:/tmp/cvs-serv11344

Modified Files:
	BaseTag.java ParserFrame.java StyleTag.java 
Log Message:
base URI defined in <base> was not used

Index: StyleTag.java
===================================================================
RCS file: /sources/public/2002/css-validator/html/tags/StyleTag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- StyleTag.java	28 Feb 2003 00:16:09 -0000	1.3
+++ StyleTag.java	26 Aug 2005 12:34:56 -0000	1.4
@@ -84,9 +84,9 @@
 		}
 		parserFrame.styleSheetParser
 		    .parseStyleElement(parserFrame.ac,
-				       new ByteArrayInputStream(text.getBytes()), 
+				     new ByteArrayInputStream(text.getBytes()),
 				       title, media, 
-				       parserFrame.url, line);
+				       parserFrame.getURI(), line);
 	    }
 	}
     }

Index: BaseTag.java
===================================================================
RCS file: /sources/public/2002/css-validator/html/tags/BaseTag.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- BaseTag.java	8 Apr 2002 21:22:41 -0000	1.2
+++ BaseTag.java	26 Aug 2005 12:34:56 -0000	1.3
@@ -80,7 +80,7 @@
 	    
 	    try { 
 		url = new URL(href); 
-		parserFrame.baseURL = url;
+		parserFrame.setBaseURI(url);
 	    } catch (MalformedURLException e) {
 		return; // Ignore errors
 	    }

Index: ParserFrame.java
===================================================================
RCS file: /sources/public/2002/css-validator/html/tags/ParserFrame.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ParserFrame.java	8 Apr 2002 21:22:41 -0000	1.2
+++ ParserFrame.java	26 Aug 2005 12:34:56 -0000	1.3
@@ -28,38 +28,48 @@
 
 public class ParserFrame {
 
-  /**
+    /**
    * The StyleSheet generator: it is used to parse all CSS informations, 
    * and then produce the specific stylesheets (CssStyles) for given 
    * contexts.
    */
 
   //  StyleSheet styleSheet = new StyleSheet(); 
-  StyleSheetParser styleSheetParser = new StyleSheetParser(); 
+    StyleSheetParser styleSheetParser = new StyleSheetParser(); 
 
-  // needed by the CSS parser
-  ApplContext ac;
+    // needed by the CSS parser
+    ApplContext ac;
 
-  /**
+    /**
    * The URL of the HTML page currently read/parsed.
    */
-  URL url;
+    URL url = null;
 
-  /**
+    /**
    * The base URL of the HTML page to resolve all relative links.
    */
-  URL baseURL;
+    URL baseURL = null;
 
-  /**
+    /**
    * The current line number in the source file
    */
-  int line;
+    int line;
 
-  /**
+    protected void setBaseURI(URL base) {
+	this.baseURL = base;
+    }
+
+    protected URL getURI() {
+	if (baseURL != null) {
+	    return baseURL;
+	}
+	return url;
+    }
+
+    /**
    * Create a new ParserFrame
    */
 
-  public ParserFrame() { 
-  }
-
+    public ParserFrame() { 
+    }
 }

Received on Friday, 26 August 2005 12:35:06 UTC