On 2011-01-08, at 08:23, André Bargull wrote:
> This also appears to fix LPP-7278.
Gee, I really ought to pay more attention to the bugs you file! Can't believe
I missed that...
> I'd use "else if (when.equals(WHEN_STYLE)) { ... "
>> @@ -1664,6 +1641,12 @@
>> if (when.equals("")) {
>> when = WHEN_ALWAYS;
>> }
>> + if (when.equals(WHEN_STYLE)) {
>> + // Handle old-school `$style{'prop'}` value
>> + // That value is a constant will be checked later
>> + // But we need to record the property now
>> + CSSAttributeProperties.put(name, value);
>> + }
>
>
> Parent model fallbacks supersede current model's fallbacks, etc.?
>> + if (parentNodeModel != null) {
>> + CSSAttributeProperties.putAll(parentNodeModel.CSSAttributeProperties);
>> + CSSAttributeTypes.putAll(parentNodeModel.CSSAttributeTypes);
>> + CSSAttributeFallbacks.putAll(parentNodeModel.CSSAttributeFallbacks);
>> + }
> same here...
>> + if (parentNodeModel != null) {
>> + CSSPropertyExpanders.putAll(parentNodeModel.CSSPropertyExpanders);
>> + CSSPropertyInheritable.putAll(parentNodeModel.CSSPropertyInheritable);
>> + }
Thanks! Brain-oh on my part. I want set union, but not to replace existing
entries. I guess I need to use something like:
private void inherit(HashMap child, HashMap parent) {
Set missing = parent.keySet();
// Wow Java, you suck. Wouldn't it make more sense to return the
// set than a boolean?
missing.removeAll(child.keySet());
for (Iterator i = missing.iterator(); i.hasNext();) {
String key = (String)i.next();
child.put(key, parent.get(key));
}
}
Unless you know of a primitive operation on Map that does that?