From 1e3127866df167535475b25b7154104f17f73506 Mon Sep 17 00:00:00 2001 From: Carlos Amengual Date: Thu, 11 Aug 2022 21:46:36 +0200 Subject: [PATCH] css: accept 'display: inline-block' as valid CSS. This is used by FontAwesome which in turn is used by Mermaid. Related to #35 --- .../io/sf/carte/echosvg/css/engine/value/ValueConstants.java | 5 +++++ .../carte/echosvg/css/engine/value/css2/DisplayManager.java | 3 ++- .../src/main/java/io/sf/carte/echosvg/util/CSSConstants.java | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueConstants.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueConstants.java index f0aee5d7b..0f39fb26d 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueConstants.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueConstants.java @@ -221,6 +221,11 @@ public interface ValueConstants { */ Value INLINE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INLINE_VALUE); + /** + * The 'inline-block' keyword. + */ + Value INLINE_BLOCK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INLINE_BLOCK_VALUE); + /** * The 'inline-table' keyword. */ diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/DisplayManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/DisplayManager.java index 05595d755..1a21ade67 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/DisplayManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/DisplayManager.java @@ -38,11 +38,12 @@ public class DisplayManager extends IdentifierManager { /** * The identifier values. */ - protected static final StringMap values = new StringMap(); + protected static final StringMap values = new StringMap(19); static { values.put(CSSConstants.CSS_BLOCK_VALUE, ValueConstants.BLOCK_VALUE); values.put(CSSConstants.CSS_COMPACT_VALUE, ValueConstants.COMPACT_VALUE); values.put(CSSConstants.CSS_INLINE_VALUE, ValueConstants.INLINE_VALUE); + values.put(CSSConstants.CSS_INLINE_BLOCK_VALUE, ValueConstants.INLINE_BLOCK_VALUE); values.put(CSSConstants.CSS_INLINE_TABLE_VALUE, ValueConstants.INLINE_TABLE_VALUE); values.put(CSSConstants.CSS_LIST_ITEM_VALUE, ValueConstants.LIST_ITEM_VALUE); values.put(CSSConstants.CSS_MARKER_VALUE, ValueConstants.MARKER_VALUE); diff --git a/echosvg-util/src/main/java/io/sf/carte/echosvg/util/CSSConstants.java b/echosvg-util/src/main/java/io/sf/carte/echosvg/util/CSSConstants.java index abecaaddb..e7a26edba 100644 --- a/echosvg-util/src/main/java/io/sf/carte/echosvg/util/CSSConstants.java +++ b/echosvg-util/src/main/java/io/sf/carte/echosvg/util/CSSConstants.java @@ -225,6 +225,7 @@ public interface CSSConstants { String CSS_INFOBACKGROUND_VALUE = "infobackground"; String CSS_INFOTEXT_VALUE = "infotext"; String CSS_INLINE_TABLE_VALUE = "inline-table"; + String CSS_INLINE_BLOCK_VALUE = "inline-block"; String CSS_INLINE_VALUE = "inline"; String CSS_ITALIC_VALUE = "italic"; String CSS_IVORY_VALUE = "ivory";