Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions org/w3c/css/parser/CssFouffa.java
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,11 @@ public CssProperty handleDeclaration(String property, CssExpression expression,

if (property.startsWith("--") && (ac.getCssVersion().compareTo(CssVersion.CSS3) >= 0)) {
prop = new CssCustomProperty(ac, property, expression);
// force early registration, it will be overwritten later but
// at least it will resolve within the block.
if (ac.getStyleSheet() != null) {
ac.getStyleSheet().addCustomProperty(property, (CssCustomProperty) prop, true);
}
// css variable
} else {
final CssValue lastValue = expression.getLastValue();
Expand Down
29 changes: 22 additions & 7 deletions org/w3c/css/parser/CssPropertyFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,14 @@ public synchronized CssProperty createProperty(ApplContext ac, AtRule atRule, St
throw new WarningParamException("vendor-extension", expression.toStringFromStart());
}

if (expression.hasCssVariable()) {
throw new WarningParamException("css-variable", expression.toStringFromStart());
}

if (ac.getTreatCssHacksAsWarnings() && expression.hasCssHack()) {
throw new WarningParamException("css-hack", expression.toStringFromStart());
}

try {
boolean isCssWide = false;
CssIdent cssIdent = null;
CssProperty p;
if ((expression.getCount() == 1) && (expression.getValue().getRawType() == CssTypes.CSS_IDENT)) {
cssIdent = expression.getValue().getIdent();
isCssWide = CssIdent.isCssWide(cssIdent);
Expand All @@ -285,7 +282,7 @@ public synchronized CssProperty createProperty(ApplContext ac, AtRule atRule, St
Object[] parameters = {};
expression.next(); // consume token
// invoke the constructor
CssProperty p = (CssProperty) constructor.newInstance(parameters);
p = (CssProperty) constructor.newInstance(parameters);
p.value = cssIdent;
return p;
} else if (isCatchall) {
Expand All @@ -294,20 +291,38 @@ public synchronized CssProperty createProperty(ApplContext ac, AtRule atRule, St
Constructor constructor = Class.forName(classname).getConstructor(parametersType);
Object[] parameters = {ac, property, expression, Boolean.TRUE};
// invoke the constructor
return (CssProperty) constructor.newInstance(parameters);
p = (CssProperty) constructor.newInstance(parameters);
if (expression.hasCssVariable() && p.toString() == null) {
p.valueString = expression.toStringFromStart();
}
return p;
} else {
// create an instance of your property class
Class[] parametersType = {ac.getClass(), expression.getClass(), boolean.class};
Constructor constructor = Class.forName(classname).getConstructor(parametersType);
Object[] parameters = {ac, expression, Boolean.TRUE};
// invoke the constructor
return (CssProperty) constructor.newInstance(parameters);
p = (CssProperty) constructor.newInstance(parameters);
if (expression.hasCssVariable() && p.toString() == null) {
p.valueString = expression.toStringFromStart();
}
return p;

}
} catch (InvocationTargetException e) {
// catch InvalidParamException
Exception ex = (Exception) e.getTargetException();
// uncomment for debug - ex.printStackTrace();
if (expression.hasCssVariable()) {
try {
CssProperty p = (CssProperty) Class.forName(classname).getConstructor().newInstance();
p.valueString = expression.toStringFromStart();
ac.getFrame().addWarning("css-variable", new String[]{p.valueString});
return p;
} catch (Exception fex) {
throw new WarningParamException("css-variable", expression.toStringFromStart());
}
}
throw ex;
}
}
Expand Down
10 changes: 0 additions & 10 deletions org/w3c/css/properties/css/CssAccentColor.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public Object get() {
return value;
}


/**
* Returns the name of this property
*/
Expand All @@ -63,13 +62,6 @@ public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
Expand All @@ -83,7 +75,6 @@ public void addToStyle(ApplContext ac, CssStyle style) {
s.cssAccentColor = this;
}


/**
* Compares two properties for equality.
*
Expand All @@ -94,7 +85,6 @@ public boolean equals(CssProperty property) {
value.equals(((CssAccentColor) property).value));
}


/**
* Get this property in the style.
*
Expand Down
10 changes: 0 additions & 10 deletions org/w3c/css/properties/css/CssAlignContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public Object get() {
return value;
}


/**
* Returns the name of this property
*/
Expand All @@ -64,13 +63,6 @@ public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
Expand All @@ -84,7 +76,6 @@ public void addToStyle(ApplContext ac, CssStyle style) {
s.cssAlignContent = this;
}


/**
* Compares two properties for equality.
*
Expand All @@ -95,7 +86,6 @@ public boolean equals(CssProperty property) {
value.equals(((CssAlignContent) property).value));
}


/**
* Get this property in the style.
*
Expand Down
10 changes: 0 additions & 10 deletions org/w3c/css/properties/css/CssAlignItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public Object get() {
return value;
}


/**
* Returns the name of this property
*/
Expand All @@ -64,13 +63,6 @@ public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
Expand All @@ -84,7 +76,6 @@ public void addToStyle(ApplContext ac, CssStyle style) {
s.cssAlignItems = this;
}


/**
* Compares two properties for equality.
*
Expand All @@ -95,7 +86,6 @@ public boolean equals(CssProperty property) {
value.equals(((CssAlignItems) property).value));
}


/**
* Get this property in the style.
*
Expand Down
10 changes: 0 additions & 10 deletions org/w3c/css/properties/css/CssAlignSelf.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public Object get() {
return value;
}


/**
* Returns the name of this property
*/
Expand All @@ -64,13 +63,6 @@ public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
Expand All @@ -84,7 +76,6 @@ public void addToStyle(ApplContext ac, CssStyle style) {
s.cssAlignSelf = this;
}


/**
* Compares two properties for equality.
*
Expand All @@ -95,7 +86,6 @@ public boolean equals(CssProperty property) {
value.equals(((CssAlignSelf) property).value));
}


/**
* Get this property in the style.
*
Expand Down
10 changes: 0 additions & 10 deletions org/w3c/css/properties/css/CssAlignmentBaseline.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public Object get() {
return value;
}


/**
* Returns the name of this property
*/
Expand All @@ -64,13 +63,6 @@ public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
Expand All @@ -84,7 +76,6 @@ public void addToStyle(ApplContext ac, CssStyle style) {
s.cssAlignmentBaseline = this;
}


/**
* Compares two properties for equality.
*
Expand All @@ -95,7 +86,6 @@ public boolean equals(CssProperty property) {
value.equals(((CssAlignmentBaseline) property).value));
}


/**
* Get this property in the style.
*
Expand Down
10 changes: 0 additions & 10 deletions org/w3c/css/properties/css/CssAll.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public Object get() {
return value;
}


/**
* Returns the name of this property
*/
Expand All @@ -62,13 +61,6 @@ public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
Expand All @@ -79,7 +71,6 @@ public void addToStyle(ApplContext ac, CssStyle style) {
// of the current style...
}


/**
* Compares two properties for equality.
*
Expand All @@ -90,7 +81,6 @@ public boolean equals(CssProperty property) {
value.equals(property.value));
}


/**
* Get this property in the style.
*
Expand Down
10 changes: 0 additions & 10 deletions org/w3c/css/properties/css/CssAnimation.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public Object get() {
return value;
}


/**
* Returns the name of this property
*/
Expand All @@ -64,13 +63,6 @@ public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
Expand All @@ -84,7 +76,6 @@ public void addToStyle(ApplContext ac, CssStyle style) {
s.cssAnimation = this;
}


/**
* Compares two properties for equality.
*
Expand All @@ -95,7 +86,6 @@ public boolean equals(CssProperty property) {
value.equals(((CssAnimation) property).value));
}


/**
* Get this property in the style.
*
Expand Down
10 changes: 0 additions & 10 deletions org/w3c/css/properties/css/CssAnimationDelay.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public Object get() {
return value;
}


/**
* Returns the name of this property
*/
Expand All @@ -64,13 +63,6 @@ public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
Expand All @@ -84,7 +76,6 @@ public void addToStyle(ApplContext ac, CssStyle style) {
s.cssAnimationDelay = this;
}


/**
* Compares two properties for equality.
*
Expand All @@ -95,7 +86,6 @@ public boolean equals(CssProperty property) {
value.equals(((CssAnimationDelay) property).value));
}


/**
* Get this property in the style.
*
Expand Down
Loading
Loading