Author: jwaldman
Date: Tue Jan 9 11:42:11 2007
New Revision: 494539
URL: http://svn.apache.org/viewvc?view=rev&rev=494539
Log:
ADFFACES-348 -tr-inhibit: all inhibits all after include styles in skin css
files
Modified:
incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java
Modified:
incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
URL:
http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css?view=diff&rev=494539&r1=494538&r2=494539
==============================================================================
---
incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
(original)
+++
incubator/adffaces/trunk/trinidad/trinidad-demo/src/main/webapp/skins/purple/purpleSkin.css
Tue Jan 9 11:42:11 2007
@@ -578,3 +578,24 @@
af|inputText::content {background-color:pink}
}
}
+
+/* Test -tr-inhibit: all and -tr-inhibit a specific css property */
+
+/* this should end up with .portlet-form-input-field {padding: 8px} */
+.portlet-form-input-field {
+/* This should first inhibit all inherited styles. Then everything else
+ should be included.*/
+ -tr-inhibit: all;
+ padding: 8px;
+ /* This should inhibit the background-color that is inherited and/or
included,
+ like in .AFLightAccentBackground:alias
+ The order of this does not matter. */
+ -tr-inhibit: background-color;
+ -tr-rule-ref: selector(".AFLightAccentBackground:alias");
+}
+
+/* This test inhibits the text-decoration property that is defined in the base
skin */
+.PortletHeaderLink {
+ -tr-inhibit: text-decoration;
+ color: pink;
+}
\ No newline at end of file
Modified:
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
URL:
http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java?view=diff&rev=494539&r1=494538&r2=494539
==============================================================================
---
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
(original)
+++
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleNode.java
Tue Jan 9 11:42:11 2007
@@ -130,8 +130,6 @@
if(_INHIBIT_ALL_VALUE.equalsIgnoreCase(property))
{ // Case insensitivity for "all" value
_inhibitAll = true;
- _inhibitedProperties = null;
- break;
}
else
{
@@ -161,7 +159,7 @@
{
return _selector;
}
-
+
/**
* Returns true if the style node has no properties.
*/
@@ -278,7 +276,7 @@
return _resetProperties;
}
- private boolean _inhibitAll;
+
private String _name;
private String _selector;
private PropertyNode[] _properties; // The property nodes
@@ -287,9 +285,12 @@
private IncludePropertyNode[] _includedProperties; // Included properties
private List<String> _inhibitedProperties; // Inhibited properties
- // This flag checks whether the style should inherit properties
+ // These flags checks whether the style should inherit properties
// from equivalent styles defined in earlier style sheets.
+ // This is xss-formatted skin files when resetProperties="true".
private boolean _resetProperties;
+ // This is css-formatted skin files when -tr-inhibit: all.
+ private boolean _inhibitAll;
private static final String _INHIBIT_ALL_VALUE = "all";
}
Modified:
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java
URL:
http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java?view=diff&rev=494539&r1=494538&r2=494539
==============================================================================
---
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java
(original)
+++
incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetDocument.java
Tue Jan 9 11:42:11 2007
@@ -515,7 +515,7 @@
// end.
// 0. Reset properties?
- if (node.__getResetProperties())
+ if (node.__getResetProperties() || node.isInhibitingAll())
entry.resetProperties();
// 1. Resolve included styles
@@ -666,18 +666,12 @@
}
// 4. Check inhibited properties
- if(node.isInhibitingAll())
+ Iterator<String> inhibitedProperties =
node.getInhibitedProperties();
+ while (inhibitedProperties.hasNext())
{
- entry.resetProperties();
- }
- else
- {
- Iterator<String> properties = node.getInhibitedProperties();
- while (properties.hasNext())
- {
- entry.removeProperty(properties.next());
- }
+ entry.removeProperty(inhibitedProperties.next());
}
+
// 5. Add non-included properties
Iterator<PropertyNode> properties = node.getProperties();