W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2012

2002/css-validator/org/w3c/css/properties/css CssBackground.java,1.11,1.12

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 28 Aug 2012 20:30:42 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1T6SQs-0006LD-Nr@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css
In directory hutz:/tmp/cvs-serv24357/css

Modified Files:
	CssBackground.java 
Log Message:
moving things back to root class

Index: CssBackground.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssBackground.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- CssBackground.java	5 Oct 2011 11:46:42 -0000	1.11
+++ CssBackground.java	28 Aug 2012 20:30:40 -0000	1.12
@@ -6,11 +6,11 @@
 // Please first read the full copyright statement in file COPYRIGHT.html
 package org.w3c.css.properties.css;
 
+import org.w3c.css.parser.CssSelectors;
 import org.w3c.css.parser.CssStyle;
 import org.w3c.css.properties.css1.Css1Style;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.InvalidParamException;
-import org.w3c.css.values.CssColor;
 import org.w3c.css.values.CssExpression;
 import org.w3c.css.values.CssValue;
 
@@ -19,9 +19,7 @@
  */
 public class CssBackground extends CssProperty {
 
-    Object value;
-
-    public CssColor _color;
+    public CssValue value;
 
     public CssBackgroundColor color;
     public CssBackgroundImage image;
@@ -69,7 +67,7 @@
      * Returns the value of this property
      */
     public Object get() {
-        return null;
+        return value;
     }
 
     /**
@@ -97,17 +95,118 @@
         return value.toString();
     }
 
+	/**
+	 * Add this property to the CssStyle
+	 *
+	 * @param style The CssStyle
+	 */
+	public void addToStyle(ApplContext ac, CssStyle style) {
+		((Css1Style) style).cssBackground.same = same;
+		((Css1Style) style).cssBackground.byUser = byUser;
 
+		if (color != null) {
+			color.addToStyle(ac, style);
+		}
+		if (image != null) {
+			image.addToStyle(ac, style);
+		}
+		if (repeat != null) {
+			repeat.addToStyle(ac, style);
+		}
+		if (attachment != null) {
+			attachment.addToStyle(ac, style);
+		}
+		if (position != null) {
+			position.addToStyle(ac, style);
+		}
+		if (size != null) {
+			size.addToStyle(ac, style);
+		}
+	}
 
-    /**
-     * Add this property to the CssStyle
-     *
-     * @param style The CssStyle
-     */
-    public void addToStyle(ApplContext ac, CssStyle style) {
-        ((Css1Style) style).cssBackground.same = same;
-        ((Css1Style) style).cssBackground.byUser = byUser;
-    }
+	/**
+	 * Set this property to be important.
+	 * Overrides this method for a macro
+	 */
+	public void setImportant() {
+		super.setImportant();
+		if (color != null) {
+			color.important = true;
+		}
+		if (image != null) {
+			image.important = true;
+		}
+		if (repeat != null) {
+			repeat.important = true;
+		}
+		if (attachment != null) {
+			attachment.important = true;
+		}
+		if (position != null) {
+			position.important = true;
+		}
+		if (size != null) {
+			size.important = true;
+		}
+	}
+
+	/**
+	 * Set the context.
+	 * Overrides this method for a macro
+	 *
+	 * @see org.w3c.css.css.CssCascadingOrder#order
+	 * @see org.w3c.css.css.StyleSheetParser#handleRule
+	 */
+	public void setSelectors(CssSelectors selector) {
+		super.setSelectors(selector);
+		if (color != null) {
+			color.setSelectors(selector);
+		}
+		if (image != null) {
+			image.setSelectors(selector);
+		}
+		if (repeat != null) {
+			repeat.setSelectors(selector);
+		}
+		if (attachment != null) {
+			attachment.setSelectors(selector);
+		}
+		if (position != null) {
+			position.setSelectors(selector);
+		}
+		if (size != null) {
+			size.setSelectors(selector);
+		}
+	}
+
+	/**
+	 * Update the source file and the line.
+	 * Overrides this method for a macro
+	 *
+	 * @param line   The line number where this property is defined
+	 * @param source The source file where this property is defined
+	 */
+	public void setInfo(int line, String source) {
+		super.setInfo(line, source);
+		if (color != null) {
+			color.setInfo(line, source);
+		}
+		if (image != null) {
+			image.setInfo(line, source);
+		}
+		if (repeat != null) {
+			repeat.setInfo(line, source);
+		}
+		if (attachment != null) {
+			attachment.setInfo(line, source);
+		}
+		if (position != null) {
+			position.setInfo(line, source);
+		}
+		if (size != null) {
+			size.setInfo(line, source);
+		}
+	}
 
     /**
      * Get this property in the style.
Received on Tuesday, 28 August 2012 20:30:43 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:51 UTC