From 921b8bbd570b83653d3ad515ada5bbe10da55dad Mon Sep 17 00:00:00 2001 From: Carlos Amengual Date: Mon, 12 Aug 2024 13:46:02 +0200 Subject: [PATCH] Switch from the legacy CSSValue API to Typed OM --- NOTICE | 12 +- buildSrc/allowed-licenses.json | 3 + .../groovy/echosvg.java-conventions.gradle | 8 +- echosvg-all/build.gradle | 26 +- .../anim/dom/SVGDOMImplementation.java | 6 +- .../carte/echosvg/anim/dom/SVGOMDocument.java | 7 +- .../echosvg/anim/dom/SVGOMSVGElement.java | 18 +- .../echosvg/anim/dom/SVGStylableElement.java | 34 +- .../AbstractSVGGradientElementBridge.java | 8 +- .../carte/echosvg/bridge/BridgeContext.java | 9 +- .../sf/carte/echosvg/bridge/CSSFontFace.java | 23 +- .../sf/carte/echosvg/bridge/CSSUtilities.java | 107 +- .../carte/echosvg/bridge/CursorManager.java | 23 +- .../carte/echosvg/bridge/ErrorConstants.java | 13 + .../sf/carte/echosvg/bridge/PaintServer.java | 267 +++- .../echosvg/bridge/SVGAnimationEngine.java | 90 +- .../sf/carte/echosvg/bridge/SVGGVTFont.java | 2 +- .../echosvg/bridge/SVGTextElementBridge.java | 98 +- .../carte/echosvg/bridge/TextUtilities.java | 18 +- .../io/sf/carte/echosvg/bridge/Viewport.java | 18 +- .../svg12/SVGSolidColorElementBridge.java | 12 +- .../color/profiles/ClayRGB-elle-V4-g22.icc | Bin 0 -> 1164 bytes .../bridge/color/profiles/Display P3.icc | Bin 0 -> 536 bytes .../color/profiles/ElleStone-legalcode.txt | 359 +++++ .../bridge/color/profiles/ITU-R_BT2020.icc | Bin 0 -> 732 bytes .../color/profiles/LargeRGB-elle-V4-g18.icc | Bin 0 -> 1164 bytes .../echosvg/bridge/color/profiles/NOTICE.txt | 7 + .../bridge/resources/Messages.properties | 5 + echosvg-css/build.gradle | 1 + .../io/sf/carte/echosvg/css/Viewport.java | 39 + .../echosvg/css/dom/CSSOMComputedStyle.java | 21 +- .../carte/echosvg/css/dom/CSSOMSVGColor.java | 1140 ++------------ .../css/dom/CSSOMSVGComputedStyle.java | 2 - .../carte/echosvg/css/dom/CSSOMSVGPaint.java | 713 ++------- .../css/dom/CSSOMSVGStyleDeclaration.java | 16 +- .../echosvg/css/dom/CSSOMSVGViewCSS.java | 2 +- .../css/dom/CSSOMStyleDeclaration.java | 58 +- .../sf/carte/echosvg/css/dom/CSSOMValue.java | 1315 ++--------------- .../carte/echosvg/css/dom/CSSOMViewCSS.java | 4 +- .../io/sf/carte/echosvg/css/dom/CSSValue.java | 358 +++++ .../carte/echosvg/css/engine/CSSContext.java | 14 +- .../css/engine/SystemColorSupport.java | 14 +- .../engine/value/AbstractColorManager.java | 173 ++- .../engine/value/AbstractCounterValue.java | 141 ++ .../css/engine/value/AbstractStringValue.java | 86 ++ .../css/engine/value/AbstractValue.java | 137 +- .../engine/value/AbstractValueFactory.java | 11 +- .../css/engine/value/AbstractValueList.java | 151 ++ .../engine/value/AbstractValueManager.java | 42 +- .../AbstractValueModificationHandler.java | 64 + .../css/engine/value/ColorFunction.java | 189 +++ .../echosvg/css/engine/value/ColorValue.java | 164 ++ .../css/engine/value/ComponentHandler.java | 61 + .../css/engine/value/ComponentValue.java | 96 ++ .../css/engine/value/ComputedValue.java | 120 +- .../css/engine/value/CounterValue.java | 65 + .../css/engine/value/CountersValue.java | 77 + .../echosvg/css/engine/value/FloatValue.java | 201 ++- .../echosvg/css/engine/value/IdentValue.java | 85 ++ .../css/engine/value/IdentifierManager.java | 15 +- .../css/engine/value/InheritValue.java | 35 +- .../css/engine/value/LCHColorValue.java | 207 +++ .../css/engine/value/LabColorValue.java | 195 +++ .../css/engine/value/LengthManager.java | 128 +- .../echosvg/css/engine/value/ListValue.java | 88 +- .../css/engine/value/NumericValue.java | 41 + .../css/engine/value/RGBColorValue.java | 237 ++- .../echosvg/css/engine/value/RectManager.java | 30 +- .../echosvg/css/engine/value/RectValue.java | 105 +- .../echosvg/css/engine/value/StringValue.java | 85 +- .../echosvg/css/engine/value/URIValue.java | 52 +- .../carte/echosvg/css/engine/value/Value.java | 153 +- .../css/engine/value/ValueConstants.java | 297 ++-- .../css/engine/value/ValueManager.java | 13 +- .../value/ValueModificationHandler.java | 31 + .../css/engine/value/css2/ClipManager.java | 15 +- .../css/engine/value/css2/CursorManager.java | 27 +- .../engine/value/css2/FontFamilyManager.java | 20 +- .../value/css2/FontShorthandManager.java | 9 +- .../value/css2/FontSizeAdjustManager.java | 22 +- .../engine/value/css2/FontSizeManager.java | 114 +- .../engine/value/css2/FontWeightManager.java | 14 +- .../css/engine/value/css2/SrcManager.java | 18 +- .../value/css2/TextDecorationManager.java | 19 +- .../value/svg/BaselineShiftManager.java | 24 +- .../css/engine/value/svg/ClipPathManager.java | 19 +- .../engine/value/svg/ColorProfileManager.java | 25 +- .../value/svg/EnableBackgroundManager.java | 35 +- .../css/engine/value/svg/FilterManager.java | 17 +- .../value/svg/GlyphOrientationManager.java | 27 +- .../svg/GlyphOrientationVerticalManager.java | 15 +- .../css/engine/value/svg/ICCColor.java | 23 +- .../css/engine/value/svg/KerningManager.java | 15 +- .../css/engine/value/svg/MarkerManager.java | 22 +- .../css/engine/value/svg/MaskManager.java | 19 +- .../css/engine/value/svg/OpacityManager.java | 14 +- .../css/engine/value/svg/SVGColorManager.java | 98 +- .../css/engine/value/svg/SVGPaintManager.java | 30 +- .../engine/value/svg/SVGValueConstants.java | 640 ++++---- .../css/engine/value/svg/SpacingManager.java | 15 +- .../value/svg/StrokeDasharrayManager.java | 32 +- .../value/svg/StrokeMiterlimitManager.java | 14 +- .../engine/value/svg12/AbstractCIEColor.java | 15 +- .../css/engine/value/svg12/CIELCHColor.java | 60 - .../css/engine/value/svg12/CIELabColor.java | 56 - .../css/engine/value/svg12/DeviceColor.java | 48 +- .../css/engine/value/svg12/ICCNamedColor.java | 23 +- .../engine/value/svg12/LineHeightManager.java | 21 +- .../value/svg12/SVG12ValueConstants.java | 20 +- echosvg-css/src/main/java/module-info.java | 2 + .../value/resources/Messages.properties | 21 +- .../echosvg/dom/AbstractStylableDocument.java | 4 +- .../dom/ExtensibleDOMImplementation.java | 2 +- .../dom/util/CSSStyleDeclarationFactory.java | 8 +- echosvg-dom/src/main/java/module-info.java | 2 + .../extension/StylableExtensionElement.java | 16 +- .../bridge/test/ModificationsTest.java | 134 ++ .../echosvg/bridge/test/PaintServerTest.java | 162 ++ .../echosvg/svggen/test/FontDecoration.java | 3 + .../test/svg/SamplesCanvgRenderingTest.java | 4 +- .../test/svg/SamplesSpecRenderingTest.java | 2 + gradle.properties | 3 +- samples/tests/spec/scripting/domSVGColor.svg | 93 +- samples/tests/spec/scripting/paintType.svg | 2 +- samples/tests/spec/scripting/relativeURI.svg | 2 +- samples/tests/spec/scripting/setProperty.svg | 2 +- .../svggen/rendering/ContextDrawImageICC.png | Bin 1480 -> 1479 bytes .../rendering/ContextFontDecoration.png | Bin 5915 -> 5931 bytes .../echosvg/svggen/rendering/DrawImageICC.png | Bin 1481 -> 1479 bytes .../svggen/rendering/FontDecoration.png | Bin 5905 -> 5923 bytes test-references/samples/canvg/issue320.png | Bin 13427 -> 11489 bytes test-references/samples/canvg/issue690.png | Bin 3517 -> 5717 bytes .../tests/spec/scripting/domSVGColor.png | Bin 32601 -> 35278 bytes .../tests/spec/scripting/paintType.png | Bin 13786 -> 12291 bytes .../io/sf/carte/echosvg/css/dom/bug11670.svg | 6 +- .../io/sf/carte/echosvg/css/dom/bug9740.svg | 12 +- .../echosvg/css/dom/rgbPresentationTest.svg | 4 +- .../io/sf/carte/echosvg/css/dom/rgbTest.svg | 6 +- .../carte/echosvg/css/dom/rgbUpdateTest.svg | 6 +- 139 files changed, 5577 insertions(+), 4949 deletions(-) create mode 100644 echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/ClayRGB-elle-V4-g22.icc create mode 100644 echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/Display P3.icc create mode 100644 echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/ElleStone-legalcode.txt create mode 100644 echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/ITU-R_BT2020.icc create mode 100644 echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/LargeRGB-elle-V4-g18.icc create mode 100644 echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/NOTICE.txt create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/Viewport.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractCounterValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractStringValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueList.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueModificationHandler.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ColorFunction.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ColorValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComponentHandler.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComponentValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/CounterValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/CountersValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/IdentValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LCHColorValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LabColorValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/NumericValue.java create mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueModificationHandler.java delete mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/CIELCHColor.java delete mode 100644 echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/CIELabColor.java create mode 100644 echosvg-test/src/test/java/io/sf/carte/echosvg/bridge/test/ModificationsTest.java create mode 100644 echosvg-test/src/test/java/io/sf/carte/echosvg/bridge/test/PaintServerTest.java diff --git a/NOTICE b/NOTICE index fe6e2dcb1..18c795b5a 100644 --- a/NOTICE +++ b/NOTICE @@ -7,12 +7,22 @@ This product includes software developed at The Apache Software Foundation (https://www.apache.org/) under the 'Apache Batik' project. This software contains code from the World Wide Web Consortium (W3C) for the -Document Object Model API (DOM API) and SVG Document Type Definition (DTD). +Document Object Model API (DOM API). This software contains code from the International Organisation for Standardization for the definition of character entities used in the software's documentation. +This software contains color profiles by Elle Stone, that are licensed as shown +in the 'ElleStone-legalcode.txt' file under the color profiles directory (bridge +module). + +This product contains a Display P3 color profile that was made by Apple and was +obtained from color.org (ICC). + +This product contains the ITU-R Recommendation BT.2020 color profile that was +also obtained from color.org (ICC). + This product includes images from the Tango Desktop Project (Former website http://tango.freedesktop.org/ archived at https://web.archive.org/web/20201024165718/http://tango-project.org/). diff --git a/buildSrc/allowed-licenses.json b/buildSrc/allowed-licenses.json index 22670b189..b1d0906af 100644 --- a/buildSrc/allowed-licenses.json +++ b/buildSrc/allowed-licenses.json @@ -15,6 +15,9 @@ { "moduleLicense": "Mozilla Public License, Version 2.0" }, + { + "moduleLicense": "W3C Software and Document Notice and License" + }, { "moduleLicense": "MIT License" } diff --git a/buildSrc/src/main/groovy/echosvg.java-conventions.gradle b/buildSrc/src/main/groovy/echosvg.java-conventions.gradle index ca73d322a..0d1e14e4c 100644 --- a/buildSrc/src/main/groovy/echosvg.java-conventions.gradle +++ b/buildSrc/src/main/groovy/echosvg.java-conventions.gradle @@ -18,6 +18,7 @@ repositories { content { includeGroup 'io.sf.carte' includeGroup 'io.sf.graphics' + includeGroup 'io.sf.w3' includeGroup 'io.sf.jclf' } } @@ -121,7 +122,7 @@ tasks.register("${project.name}-jar-with-deps", Jar) { // Provided by Java SE exclude 'javax/**' // Not used by EchoSVG - exclude 'org/w3c/css/**' + exclude 'org/w3c/css/sac/**' // The next ones are provided by java.xml module exclude 'org/w3c/dom/*' exclude 'org/w3c/dom/bootstrap/**' @@ -131,6 +132,11 @@ tasks.register("${project.name}-jar-with-deps", Jar) { exclude 'org/w3c/dom/traversal/**' exclude 'org/w3c/dom/views/**' exclude 'org/xml/**' + // Provided by jdk.xml.dom module + exclude 'org/w3c/dom/css/**' + exclude 'org/w3c/dom/html/**' + exclude 'org/w3c/dom/stylesheets/**' + exclude 'org/w3c/dom/xpath/**' // Modularity does not apply here exclude 'module-info.class' } diff --git a/echosvg-all/build.gradle b/echosvg-all/build.gradle index b2a2717a3..d781a1285 100644 --- a/echosvg-all/build.gradle +++ b/echosvg-all/build.gradle @@ -61,6 +61,11 @@ tasks.register('cloneRepos') { refToCheckout: "v${svgomVersion}") gitWebAPIs?.close() + def gitCSSAPIs = grgit.clone(dir: "$buildDir/repos/cssom-apis", + uri: 'https://github.com/css4j/cssom-apis.git', + refToCheckout: "v0.1") + gitCSSAPIs?.close() + def gitLegacyColors = grgit.clone(dir: "$buildDir/repos/legacy-colors", uri: 'https://github.com/css4j/legacy-colors.git', refToCheckout: "v${legacyColorsVersion}") @@ -208,6 +213,18 @@ tasks.register('prepareModularSources') { include(name: '**/*') } } + + // CSSOM and DOM View APIs + ant.copy(todir: "$buildDir/src/org.w3c.css.om") { + fileset(dir: "$buildDir/repos/cssom-apis/cssom-api/src/main/java") { + include(name: '**/*') + } + } + ant.copy(todir: "$buildDir/src/org.w3c.dom.view") { + fileset(dir: "$buildDir/repos/cssom-apis/domview-api/src/main/java") { + include(name: '**/*') + } + } } } @@ -243,6 +260,8 @@ tasks.register('modularJavadoc', Javadoc) { "$buildDir/src/io.sf.carte.echosvg.util.gui", "$buildDir/src/io.sf.carte.echosvg.xml", "$buildDir/src/io.sf.graphics.legacy.colors", + "$buildDir/src/org.w3c.css.om", + "$buildDir/src/org.w3c.dom.view", "$buildDir/src/org.w3c.dom.smil", "$buildDir/src/org.w3c.dom.svg" ] includes += '**/*.java' @@ -282,7 +301,7 @@ tasks.register('uberjar', Jar) { // Provided by Java SE exclude 'javax/**' // Not used by EchoSVG - exclude 'org/w3c/css/**' + exclude 'org/w3c/css/sac/**' // The next ones are provided by java.xml module exclude 'org/w3c/dom/*' exclude 'org/w3c/dom/bootstrap/**' @@ -292,6 +311,11 @@ tasks.register('uberjar', Jar) { exclude 'org/w3c/dom/traversal/**' exclude 'org/w3c/dom/views/**' exclude 'org/xml/**' + // Provided by jdk.xml.dom module + exclude 'org/w3c/dom/css/**' + exclude 'org/w3c/dom/html/**' + exclude 'org/w3c/dom/stylesheets/**' + exclude 'org/w3c/dom/xpath/**' // Modularity does not apply here exclude 'module-info.class' diff --git a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGDOMImplementation.java b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGDOMImplementation.java index e473c6e75..0faca4948 100644 --- a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGDOMImplementation.java +++ b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGDOMImplementation.java @@ -25,17 +25,17 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; +import org.w3c.css.om.CSSStyleDeclaration; +import org.w3c.css.om.CSSStyleSheet; import org.w3c.dom.DOMException; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.w3c.dom.Element; import org.w3c.dom.Node; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSStyleSheet; -import org.w3c.dom.css.ViewCSS; import org.w3c.dom.events.Event; import org.w3c.dom.stylesheets.StyleSheet; +import org.w3c.dom.view.ViewCSS; import io.sf.carte.doc.style.css.nsac.InputSource; import io.sf.carte.doc.style.css.nsac.Parser; diff --git a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGOMDocument.java b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGOMDocument.java index e2209668e..2e39d7111 100644 --- a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGOMDocument.java +++ b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGOMDocument.java @@ -27,6 +27,7 @@ import java.util.Locale; import java.util.MissingResourceException; +import org.w3c.css.om.CSSStyleDeclaration; import org.w3c.dom.Attr; import org.w3c.dom.CDATASection; import org.w3c.dom.Comment; @@ -40,8 +41,6 @@ import org.w3c.dom.Node; import org.w3c.dom.ProcessingInstruction; import org.w3c.dom.Text; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.DocumentCSS; import org.w3c.dom.events.Event; import org.w3c.dom.events.EventListener; import org.w3c.dom.events.MutationEvent; @@ -687,9 +686,9 @@ public void otherAnimationChanged(Element e, String type) { // DocumentCSS //////////////////////////////////////////////////////////// /** - * DOM: Implements {@link DocumentCSS#getOverrideStyle(Element,String)}. + * This does not implement {@code DocumentCSS#getOverrideStyle(Element,String)} + * anymore, as it does not support Typed OM. */ - @Override public CSSStyleDeclaration getOverrideStyle(Element elt, String pseudoElt) { if (elt instanceof SVGStylableElement && pseudoElt == null) { return ((SVGStylableElement) elt).getOverrideStyle(); diff --git a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGOMSVGElement.java b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGOMSVGElement.java index b2bdfb52a..8d99179fa 100644 --- a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGOMSVGElement.java +++ b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGOMSVGElement.java @@ -21,13 +21,11 @@ import java.awt.geom.AffineTransform; import java.util.List; +import org.w3c.css.om.CSSStyleDeclaration; import org.w3c.dom.DOMException; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.DocumentCSS; -import org.w3c.dom.css.ViewCSS; import org.w3c.dom.events.DocumentEvent; import org.w3c.dom.events.Event; import org.w3c.dom.stylesheets.DocumentStyle; @@ -48,6 +46,8 @@ import org.w3c.dom.svg.SVGStringList; import org.w3c.dom.svg.SVGTransform; import org.w3c.dom.svg.SVGViewSpec; +import org.w3c.dom.view.DocumentCSS; +import org.w3c.dom.view.ViewCSS; import org.w3c.dom.views.AbstractView; import org.w3c.dom.views.DocumentView; @@ -716,10 +716,6 @@ public DocumentView getDocument() { return (DocumentView) getOwnerDocument(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.ViewCSS#getComputedStyle(Element,String)}. - */ @Override public CSSStyleDeclaration getComputedStyle(Element elt, String pseudoElt) { AbstractView av = ((DocumentView) getOwnerDocument()).getDefaultView(); @@ -748,19 +744,11 @@ public boolean canDispatch(String namespaceURI, String type) throws DOMException // DocumentCSS //////////////////////////////////////////////////////////// - /** - * DOM: Implements - * {@link org.w3c.dom.stylesheets.DocumentStyle#getStyleSheets()}. - */ @Override public StyleSheetList getStyleSheets() { return ((DocumentStyle) getOwnerDocument()).getStyleSheets(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.DocumentCSS#getOverrideStyle(Element,String)}. - */ @Override public CSSStyleDeclaration getOverrideStyle(Element elt, String pseudoElt) { return ((DocumentCSS) getOwnerDocument()).getOverrideStyle(elt, pseudoElt); diff --git a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGStylableElement.java b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGStylableElement.java index c1fed720a..88a086323 100644 --- a/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGStylableElement.java +++ b/echosvg-anim/src/main/java/io/sf/carte/echosvg/anim/dom/SVGStylableElement.java @@ -18,11 +18,11 @@ */ package io.sf.carte.echosvg.anim.dom; +import org.w3c.css.om.CSSStyleDeclaration; +import org.w3c.css.om.typed.CSSStyleValue; import org.w3c.dom.Attr; import org.w3c.dom.DOMException; import org.w3c.dom.Node; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; import org.w3c.dom.svg.SVGAnimatedString; import io.sf.carte.echosvg.anim.values.AnimatableValue; @@ -35,6 +35,7 @@ import io.sf.carte.echosvg.css.engine.SVGCSSEngine; import io.sf.carte.echosvg.css.engine.StyleDeclarationProvider; import io.sf.carte.echosvg.css.engine.StyleMap; +import io.sf.carte.echosvg.css.engine.value.AbstractValueModificationHandler; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.svg.SVGColorManager; import io.sf.carte.echosvg.css.engine.value.svg.SVGPaintManager; @@ -48,8 +49,10 @@ * This class provides a common superclass for elements which implement * SVGStylable. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public abstract class SVGStylableElement extends SVGOMElement implements CSSStylableElement { @@ -227,7 +230,7 @@ public void updatePropertyValue(String pn, AnimatableValue val) { public boolean useLinearRGBColorInterpolation() { CSSEngine eng = ((SVGOMDocument) getOwnerDocument()).getCSSEngine(); Value v = eng.getComputedStyle(this, null, SVGCSSEngine.COLOR_INTERPOLATION_INDEX); - return v.getStringValue().charAt(0) == 'l'; + return v.getIdentifierValue().charAt(0) == 'l'; } /** @@ -262,9 +265,6 @@ public void removeTargetListener(String ns, String an, boolean isCSS, AnimationT // SVGStylable support /////////////////////////////////////////////////// - /** - * DOM: Implements {@link org.w3c.dom.svg.SVGStylable#getStyle()}. - */ public CSSStyleDeclaration getStyle() { if (style == null) { CSSEngine eng = ((SVGOMDocument) getOwnerDocument()).getCSSEngine(); @@ -274,12 +274,8 @@ public CSSStyleDeclaration getStyle() { return style; } - /** - * DOM: Implements - * {@link org.w3c.dom.svg.SVGStylable#getPresentationAttribute(String)}. - */ - public CSSValue getPresentationAttribute(String name) { - CSSValue result = (CSSValue) getLiveAttributeValue(null, name); + public CSSStyleValue getPresentationAttributeValue(String name) { + CSSStyleValue result = (CSSStyleValue) getLiveAttributeValue(null, name); if (result != null) return result; @@ -365,14 +361,14 @@ public class PresentationAttributeValue extends CSSOMValue implements LiveAttrib public PresentationAttributeValue(CSSEngine eng, String prop) { super(null); valueProvider = this; - setModificationHandler(new AbstractModificationHandler() { + setModificationHandler(new AbstractValueModificationHandler() { @Override protected Value getValue() { return PresentationAttributeValue.this.getValue(); } @Override - public void textChanged(String text) throws DOMException { + protected void setPropertyText(String text) throws DOMException { value = cssEngine.parsePropertyValue(SVGStylableElement.this, property, text); mutate = true; setAttributeNS(null, property, text); @@ -468,14 +464,14 @@ public class PresentationAttributeColorValue extends CSSOMSVGColor public PresentationAttributeColorValue(CSSEngine eng, String prop) { super(null); valueProvider = this; - setModificationHandler(new AbstractModificationHandler() { + setModificationHandler(new AbstractValueModificationHandler() { @Override protected Value getValue() { return PresentationAttributeColorValue.this.getValue(); } @Override - public void textChanged(String text) throws DOMException { + protected void setPropertyText(String text) throws DOMException { value = cssEngine.parsePropertyValue(SVGStylableElement.this, property, text); mutate = true; setAttributeNS(null, property, text); @@ -578,7 +574,7 @@ protected Value getValue() { } @Override - public void textChanged(String text) throws DOMException { + protected void setPropertyText(String text) throws DOMException { value = cssEngine.parsePropertyValue(SVGStylableElement.this, property, text); mutate = true; setAttributeNS(null, property, text); diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/AbstractSVGGradientElementBridge.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/AbstractSVGGradientElementBridge.java index e5b48fd52..7e49e64f2 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/AbstractSVGGradientElementBridge.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/AbstractSVGGradientElementBridge.java @@ -296,7 +296,13 @@ public Stop createStop(BridgeContext ctx, Element gradientElement, Element stopE // use default value offset = 0f; } - Color color = CSSUtilities.convertStopColor(stopElement, opacity, ctx); + Color color; + try { + color = CSSUtilities.convertStopColor(stopElement, opacity, ctx); + } catch (Exception ex) { + throw new BridgeException(ctx, stopElement, ex, ERR_CSS_VALUE_ERROR, + new Object[] { ex }); + } return new Stop(color, offset); } diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/BridgeContext.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/BridgeContext.java index def8d791b..76c02f064 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/BridgeContext.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/BridgeContext.java @@ -803,6 +803,7 @@ public Element getReferencedElement(Element e, String uri) { * * @param e the element interested in its viewport */ + @Override public Viewport getViewport(Element e) { if (viewportStack != null) { // building time @@ -1896,11 +1897,9 @@ public boolean checkInteractiveElement(SVGDocument doc, Element e) { * * // Check if cursor property is set to something other than 'auto'. Value * cursorValue = CSSUtilities.getComputedStyle (e, SVGCSSEngine.CURSOR_INDEX); - * if ((cursorValue != null) && (cursorValue.getCssValueType() == - * CSSValue.CSS_PRIMITIVE_VALUE) && (cursorValue.getPrimitiveType() == - * CSSPrimitiveValue.CSS_IDENT) && - * (SVGConstants.SVG_AUTO_VALUE.equals(cursorValue.getStringValue()))) return - * true; + * if ((cursorValue != null) && (cursorValue.getPrimitiveType() == Type.IDENT) + * && (SVGConstants.SVG_AUTO_VALUE.equals(cursorValue.getIdentifierValue()))) + * return true; */ // Check all the child elements for any of the above. diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CSSFontFace.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CSSFontFace.java index 3fece4672..705c0a68a 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CSSFontFace.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CSSFontFace.java @@ -21,9 +21,8 @@ import java.util.LinkedList; import java.util.List; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; - +import io.sf.carte.echosvg.css.dom.CSSValue.CssType; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.FontFaceRule; import io.sf.carte.echosvg.css.engine.SVGCSSEngine; @@ -85,10 +84,10 @@ public static CSSFontFace createCSSFontFace(CSSEngine eng, FontFaceRule ffr) { ParsedURL base = ffr.getURL(); if ((v != null) && (v != ValueConstants.NONE_VALUE)) { - if (v.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { + if (v.getCssValueType() == CssType.TYPED) { ret.srcs = new LinkedList<>(); ret.srcs.add(getSrcValue(v, base)); - } else if (v.getCssValueType() == CSSValue.CSS_VALUE_LIST) { + } else if (v.getCssValueType() == CssType.LIST) { ret.srcs = new LinkedList<>(); for (int i = 0; i < v.getLength(); i++) { ret.srcs.add(getSrcValue(v.item(i), base)); @@ -115,14 +114,12 @@ public static CSSFontFace createCSSFontFace(CSSEngine eng, FontFaceRule ffr) { } public static Object getSrcValue(Value v, ParsedURL base) { - if (v.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE) - return null; - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_URI) { + if (v.getPrimitiveType() == Type.URI) { if (base != null) - return new ParsedURL(base, v.getStringValue()); - return new ParsedURL(v.getStringValue()); + return new ParsedURL(base, v.getURIValue()); + return new ParsedURL(v.getURIValue()); } - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_STRING) + if (v.getPrimitiveType() == Type.STRING) return v.getStringValue(); return null; } @@ -134,7 +131,7 @@ public static String getStringProp(StyleMap sm, CSSEngine eng, int pidx) { ValueManager vm = vms[pidx]; v = vm.getDefaultValue(); } - while (v.getCssValueType() == CSSValue.CSS_VALUE_LIST) { + while (v.getCssValueType() == CssType.LIST) { v = v.item(0); } return v.getStringValue(); @@ -147,7 +144,7 @@ public static float getFloatProp(StyleMap sm, CSSEngine eng, int pidx) { ValueManager vm = vms[pidx]; v = vm.getDefaultValue(); } - while (v.getCssValueType() == CSSValue.CSS_VALUE_LIST) { + while (v.getCssValueType() == CssType.LIST) { v = v.item(0); } return v.getFloatValue(); diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CSSUtilities.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CSSUtilities.java index 07c2b5360..da10fdde3 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CSSUtilities.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CSSUtilities.java @@ -27,15 +27,15 @@ import java.awt.geom.Rectangle2D; import org.w3c.dom.Element; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import io.sf.carte.echosvg.anim.dom.SVGOMDocument; import io.sf.carte.echosvg.constants.XMLConstants; +import io.sf.carte.echosvg.css.dom.CSSValue.CssType; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.SVGCSSEngine; -import io.sf.carte.echosvg.css.engine.value.ListValue; +import io.sf.carte.echosvg.css.engine.value.RectValue; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.ext.awt.MultipleGradientPaint; import io.sf.carte.echosvg.ext.awt.image.renderable.ClipRable; @@ -99,7 +99,7 @@ public static Value getComputedStyle(Element e, int property) { */ public static int convertPointerEvents(Element e) { Value v = getComputedStyle(e, SVGCSSEngine.POINTER_EVENTS_INDEX); - String s = v.getStringValue(); + String s = v.getIdentifierValue(); switch (s.charAt(0)) { case 'v': if (s.length() == 7) { @@ -146,11 +146,10 @@ public static int convertPointerEvents(Element e) { public static Rectangle2D convertEnableBackground(Element e /* * , UnitProcessor.Context uctx */) { - Value v = getComputedStyle(e, SVGCSSEngine.ENABLE_BACKGROUND_INDEX); - if (v.getCssValueType() != CSSValue.CSS_VALUE_LIST) { + Value lv = getComputedStyle(e, SVGCSSEngine.ENABLE_BACKGROUND_INDEX); + if (lv.getCssValueType() != CssType.LIST) { return null; // accumulate } - ListValue lv = (ListValue) v; int length = lv.getLength(); switch (length) { case 1: @@ -180,7 +179,7 @@ public static Rectangle2D convertEnableBackground(Element e /* */ public static boolean convertColorInterpolationFilters(Element e) { Value v = getComputedStyle(e, SVGCSSEngine.COLOR_INTERPOLATION_FILTERS_INDEX); - return CSS_LINEARRGB_VALUE == v.getStringValue(); + return CSS_LINEARRGB_VALUE == v.getIdentifierValue(); } ///////////////////////////////////////////////////////////////////////// @@ -195,7 +194,7 @@ public static boolean convertColorInterpolationFilters(Element e) { */ public static MultipleGradientPaint.ColorSpaceEnum convertColorInterpolation(Element e) { Value v = getComputedStyle(e, SVGCSSEngine.COLOR_INTERPOLATION_INDEX); - return (CSS_LINEARRGB_VALUE == v.getStringValue()) ? MultipleGradientPaint.LINEAR_RGB + return (CSS_LINEARRGB_VALUE == v.getIdentifierValue()) ? MultipleGradientPaint.LINEAR_RGB : MultipleGradientPaint.SRGB; } @@ -211,15 +210,13 @@ public static boolean isAutoCursor(Element e) { boolean isAuto = false; if (cursorValue != null) { - if (cursorValue.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE - && cursorValue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT - && cursorValue.getStringValue().charAt(0) == 'a') { + if (cursorValue.getPrimitiveType() == Type.IDENT + && cursorValue.getIdentifierValue().charAt(0) == 'a') { isAuto = true; - } else if (cursorValue.getCssValueType() == CSSValue.CSS_VALUE_LIST && cursorValue.getLength() == 1) { + } else if (cursorValue.getCssValueType() == CssType.LIST && cursorValue.getLength() == 1) { Value lValue = cursorValue.item(0); - if (lValue != null && lValue.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE - && lValue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT - && lValue.getStringValue().charAt(0) == 'a') { + if (lValue != null && lValue.getPrimitiveType() == Type.IDENT + && lValue.getIdentifierValue().charAt(0) == 'a') { isAuto = true; } } @@ -281,7 +278,7 @@ public static Cursor convertCursor(Element e, BridgeContext ctx) { */ public static RenderingHints convertShapeRendering(Element e, RenderingHints hints) { Value v = getComputedStyle(e, SVGCSSEngine.SHAPE_RENDERING_INDEX); - String s = v.getStringValue(); + String s = v.getIdentifierValue(); int len = s.length(); if ((len == 4) && (s.charAt(0) == 'a')) // auto return hints; @@ -360,7 +357,7 @@ public static RenderingHints convertShapeRendering(Element e, RenderingHints hin */ public static RenderingHints convertTextRendering(Element e, RenderingHints hints) { Value v = getComputedStyle(e, SVGCSSEngine.TEXT_RENDERING_INDEX); - String s = v.getStringValue(); + String s = v.getIdentifierValue(); int len = s.length(); if ((len == 4) && (s.charAt(0) == 'a')) // auto return hints; @@ -428,7 +425,7 @@ public static RenderingHints convertTextRendering(Element e, RenderingHints hint */ public static RenderingHints convertImageRendering(Element e, RenderingHints hints) { Value v = getComputedStyle(e, SVGCSSEngine.IMAGE_RENDERING_INDEX); - String s = v.getStringValue(); + String s = v.getIdentifierValue(); int len = s.length(); if ((len == 4) && (s.charAt(0) == 'a')) // auto return hints; @@ -483,7 +480,7 @@ public static RenderingHints convertImageRendering(Element e, RenderingHints hin */ public static RenderingHints convertColorRendering(Element e, RenderingHints hints) { Value v = getComputedStyle(e, SVGCSSEngine.COLOR_RENDERING_INDEX); - String s = v.getStringValue(); + String s = v.getIdentifierValue(); int len = s.length(); if ((len == 4) && (s.charAt(0) == 'a')) // auto return hints; @@ -521,7 +518,7 @@ public static boolean convertDisplay(Element e) { return true; } Value v = getComputedStyle(e, SVGCSSEngine.DISPLAY_INDEX); - return v.getStringValue().charAt(0) != 'n'; + return v.getIdentifierValue().charAt(0) != 'n'; } ///////////////////////////////////////////////////////////////////////// @@ -536,7 +533,7 @@ public static boolean convertDisplay(Element e) { */ public static boolean convertVisibility(Element e) { Value v = getComputedStyle(e, SVGCSSEngine.VISIBILITY_INDEX); - return v.getStringValue().charAt(0) == 'v'; + return v.getIdentifierValue().charAt(0) == 'v'; } ///////////////////////////////////////////////////////////////////////// @@ -576,7 +573,7 @@ public static Composite convertOpacity(Element e) { */ public static boolean convertOverflow(Element e) { Value v = getComputedStyle(e, SVGCSSEngine.OVERFLOW_INDEX); - String s = v.getStringValue(); + String s = v.getIdentifierValue(); return (s.charAt(0) == 'h') || (s.charAt(0) == 's'); } @@ -588,20 +585,20 @@ public static boolean convertOverflow(Element e) { */ public static float[] convertClip(Element e) { Value v = getComputedStyle(e, SVGCSSEngine.CLIP_INDEX); - int primitiveType = v.getPrimitiveType(); - switch (primitiveType) { - case CSSPrimitiveValue.CSS_RECT: + switch (v.getPrimitiveType()) { + case RECT: float[] off = new float[4]; - off[0] = v.getTop().getFloatValue(); - off[1] = v.getRight().getFloatValue(); - off[2] = v.getBottom().getFloatValue(); - off[3] = v.getLeft().getFloatValue(); + RectValue rect = v.getRectValue(); + off[0] = rect.getTop().getFloatValue(); + off[1] = rect.getRight().getFloatValue(); + off[2] = rect.getBottom().getFloatValue(); + off[3] = rect.getLeft().getFloatValue(); return off; - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: return null; // 'auto' means no offsets default: // can't be reached - throw new IllegalStateException("Unexpected primitiveType:" + primitiveType); + throw new IllegalStateException("Unexpected primitiveType: " + v.getPrimitiveType()); } } @@ -619,13 +616,13 @@ public static float[] convertClip(Element e) { */ public static Filter convertFilter(Element filteredElement, GraphicsNode filteredNode, BridgeContext ctx) { Value v = getComputedStyle(filteredElement, SVGCSSEngine.FILTER_INDEX); - int primitiveType = v.getPrimitiveType(); + Type primitiveType = v.getPrimitiveType(); switch (primitiveType) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: return null; // 'filter:none' - case CSSPrimitiveValue.CSS_URI: - String uri = v.getStringValue(); + case URI: + String uri = v.getURIValue(); Element filter = ctx.getReferencedElement(filteredElement, uri); if (filter == null) { return null; // Missing reference @@ -666,13 +663,13 @@ public static Filter convertFilter(Element filteredElement, GraphicsNode filtere */ public static ClipRable convertClipPath(Element clippedElement, GraphicsNode clippedNode, BridgeContext ctx) { Value v = getComputedStyle(clippedElement, SVGCSSEngine.CLIP_PATH_INDEX); - int primitiveType = v.getPrimitiveType(); + Type primitiveType = v.getPrimitiveType(); switch (primitiveType) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: return null; // 'clip-path:none' - case CSSPrimitiveValue.CSS_URI: - String uri = v.getStringValue(); + case URI: + String uri = v.getURIValue(); Element cp = ctx.getReferencedElement(clippedElement, uri); if (cp == null) { return null; // Missing reference @@ -706,7 +703,7 @@ public static ClipRable convertClipPath(Element clippedElement, GraphicsNode cli */ public static int convertClipRule(Element e) { Value v = getComputedStyle(e, SVGCSSEngine.CLIP_RULE_INDEX); - return (v.getStringValue().charAt(0) == 'n') ? Path2D.WIND_NON_ZERO : Path2D.WIND_EVEN_ODD; + return (v.getIdentifierValue().charAt(0) == 'n') ? Path2D.WIND_NON_ZERO : Path2D.WIND_EVEN_ODD; } ///////////////////////////////////////////////////////////////////////// @@ -723,13 +720,13 @@ public static int convertClipRule(Element e) { */ public static Mask convertMask(Element maskedElement, GraphicsNode maskedNode, BridgeContext ctx) { Value v = getComputedStyle(maskedElement, SVGCSSEngine.MASK_INDEX); - int primitiveType = v.getPrimitiveType(); + Type primitiveType = v.getPrimitiveType(); switch (primitiveType) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: return null; // 'mask:none' - case CSSPrimitiveValue.CSS_URI: - String uri = v.getStringValue(); + case URI: + String uri = v.getURIValue(); Element m = ctx.getReferencedElement(maskedElement, uri); if (m == null) { return null; // Missing reference @@ -763,7 +760,7 @@ public static Mask convertMask(Element maskedElement, GraphicsNode maskedNode, B */ public static int convertFillRule(Element e) { Value v = getComputedStyle(e, SVGCSSEngine.FILL_RULE_INDEX); - return (v.getStringValue().charAt(0) == 'n') ? Path2D.WIND_NON_ZERO : Path2D.WIND_EVEN_ODD; + return (v.getIdentifierValue().charAt(0) == 'n') ? Path2D.WIND_NON_ZERO : Path2D.WIND_EVEN_ODD; } ///////////////////////////////////////////////////////////////////////// @@ -779,8 +776,8 @@ public static int convertFillRule(Element e) { */ public static Color convertLightingColor(Element e, BridgeContext ctx) { Value v = getComputedStyle(e, SVGCSSEngine.LIGHTING_COLOR_INDEX); - if (v.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { - return PaintServer.convertColor(v, 1); + if (v.getCssValueType() != CssType.LIST) { + return PaintServer.convertColor(v.getColorValue(), 1); } else { return PaintServer.convertRGBICCColor(e, v.item(0), v.item(1), 1, ctx); } @@ -801,8 +798,8 @@ public static Color convertFloodColor(Element e, BridgeContext ctx) { Value v = getComputedStyle(e, SVGCSSEngine.FLOOD_COLOR_INDEX); Value o = getComputedStyle(e, SVGCSSEngine.FLOOD_OPACITY_INDEX); float f = PaintServer.convertOpacity(o); - if (v.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { - return PaintServer.convertColor(v, f); + if (v.getCssValueType() != CssType.LIST) { + return PaintServer.convertColor(v.getColorValue(), f); } else { return PaintServer.convertRGBICCColor(e, v.item(0), v.item(1), f, ctx); } @@ -824,8 +821,8 @@ public static Color convertStopColor(Element e, float opacity, BridgeContext ctx Value v = getComputedStyle(e, SVGCSSEngine.STOP_COLOR_INDEX); Value o = getComputedStyle(e, SVGCSSEngine.STOP_OPACITY_INDEX); opacity *= PaintServer.convertOpacity(o); - if (v.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { - return PaintServer.convertColor(v, opacity); + if (v.getCssValueType() != CssType.LIST) { + return PaintServer.convertColor(v.getColorValue(), opacity); } else { return PaintServer.convertRGBICCColor(e, v.item(0), v.item(1), opacity, ctx); } @@ -865,13 +862,13 @@ public static void computeStyleAndURIs(Element refElement, Element localRefEleme ///////////////////////////////////////////////////////////////////////// /** - * Returns the winding rule represented by the specified CSSValue. + * Returns the winding rule represented by the specified Value. * * @param v the value that represents the rule * @return GeneralPath.WIND_NON_ZERO | GeneralPath.WIND_EVEN_ODD */ - protected static int rule(CSSValue v) { - return (((CSSPrimitiveValue) v).getStringValue().charAt(0) == 'n') ? Path2D.WIND_NON_ZERO + protected static int rule(Value v) { + return v.getIdentifierValue().charAt(0) == 'n' ? Path2D.WIND_NON_ZERO : Path2D.WIND_EVEN_ODD; } diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CursorManager.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CursorManager.java index 125bd59bb..89114b1b7 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CursorManager.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/CursorManager.java @@ -37,11 +37,11 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import org.w3c.dom.svg.SVGDocument; import org.w3c.dom.svg.SVGPreserveAspectRatio; +import io.sf.carte.echosvg.css.dom.CSSValue.CssType; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.SVGCSSEngine; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.dom.AbstractNode; @@ -174,18 +174,17 @@ public Cursor convertCursor(Element e) { String cursorStr = SVGConstants.SVG_AUTO_VALUE; if (cursorValue != null) { - if (cursorValue.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE - && cursorValue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { + if (cursorValue.getPrimitiveType() == Type.IDENT) { // Single Value : should be one of the predefined cursors or // 'inherit' - cursorStr = cursorValue.getStringValue(); + cursorStr = cursorValue.getIdentifierValue(); return convertBuiltInCursor(e, cursorStr); - } else if (cursorValue.getCssValueType() == CSSValue.CSS_VALUE_LIST) { + } else if (cursorValue.getCssValueType() == CssType.LIST) { int nValues = cursorValue.getLength(); if (nValues == 1) { cursorValue = cursorValue.item(0); - if (cursorValue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { - cursorStr = cursorValue.getStringValue(); + if (cursorValue.getPrimitiveType() == Type.IDENT) { + cursorStr = cursorValue.getIdentifierValue(); return convertBuiltInCursor(e, cursorStr); } } else if (nValues > 1) { @@ -273,8 +272,8 @@ public Cursor convertSVGCursor(Element e, Value l) { Element cursorElement = null; for (int i = 0; i < nValues - 1; i++) { Value cursorValue = l.item(i); - if (cursorValue.getPrimitiveType() == CSSPrimitiveValue.CSS_URI) { - String uri = cursorValue.getStringValue(); + if (cursorValue.getPrimitiveType() == Type.URI) { + String uri = cursorValue.getURIValue(); // If the uri does not resolve to a cursor element, // then, this is not a type of cursor uri we can handle: @@ -310,8 +309,8 @@ public Cursor convertSVGCursor(Element e, Value l) { // Fallback on the built in cursor property. Value cursorValue = l.item(nValues - 1); String cursorStr = SVGConstants.SVG_AUTO_VALUE; - if (cursorValue.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { - cursorStr = cursorValue.getStringValue(); + if (cursorValue.getPrimitiveType() == Type.IDENT) { + cursorStr = cursorValue.getIdentifierValue(); } return convertBuiltInCursor(e, cursorStr); diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/ErrorConstants.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/ErrorConstants.java index ba8a534ba..0a0415691 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/ErrorConstants.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/ErrorConstants.java @@ -74,6 +74,19 @@ public interface ErrorConstants { */ String ERR_CSS_URI_BAD_TARGET = "css.uri.badTarget"; + /** + * The error code when a URI specified in a CSS property referenced a bad + * element. + * + *
+	 * {0} = the uri
+	 * {1} = the line
+	 * {2} = the local name
+	 * {3} = the exception
+	 * 
+ */ + String ERR_CSS_VALUE_ERROR = "css.badValue"; + /** * The error code when a specified URI references a bad element. * diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/PaintServer.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/PaintServer.java index 1d758d341..f2b508f76 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/PaintServer.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/PaintServer.java @@ -23,25 +23,25 @@ import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; +import java.awt.color.ColorSpace; +import java.awt.color.ICC_ColorSpace; import java.awt.color.ICC_Profile; import java.io.IOException; +import java.io.InputStream; -import io.sf.graphics.java2d.color.CIELabColorSpace; -import io.sf.graphics.java2d.color.ColorSpaces; -import io.sf.graphics.java2d.color.ColorWithAlternatives; -import io.sf.graphics.java2d.color.DeviceCMYKColorSpace; -import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; -import io.sf.graphics.java2d.color.NamedColorSpace; -import io.sf.graphics.java2d.color.profile.NamedColorProfile; -import io.sf.graphics.java2d.color.profile.NamedColorProfileParser; +import org.w3c.css.om.typed.CSSStyleValueList; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.Element; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; +import io.sf.carte.echosvg.css.dom.CSSValue.CssType; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.SVGCSSEngine; +import io.sf.carte.echosvg.css.engine.value.ColorFunction; +import io.sf.carte.echosvg.css.engine.value.ColorValue; +import io.sf.carte.echosvg.css.engine.value.NumericValue; +import io.sf.carte.echosvg.css.engine.value.RGBColorValue; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.svg.ICCColor; -import io.sf.carte.echosvg.css.engine.value.svg12.CIELabColor; import io.sf.carte.echosvg.css.engine.value.svg12.DeviceColor; import io.sf.carte.echosvg.css.engine.value.svg12.ICCNamedColor; import io.sf.carte.echosvg.gvt.CompositeShapePainter; @@ -54,6 +54,13 @@ import io.sf.carte.echosvg.gvt.StrokeShapePainter; import io.sf.carte.echosvg.util.CSSConstants; import io.sf.carte.echosvg.util.SVGConstants; +import io.sf.graphics.java2d.color.ColorSpaces; +import io.sf.graphics.java2d.color.ColorWithAlternatives; +import io.sf.graphics.java2d.color.DeviceCMYKColorSpace; +import io.sf.graphics.java2d.color.ICCColorSpaceWithIntent; +import io.sf.graphics.java2d.color.NamedColorSpace; +import io.sf.graphics.java2d.color.profile.NamedColorProfile; +import io.sf.graphics.java2d.color.profile.NamedColorProfileParser; /** * A collection of utility methods to deliver java.awt.Paint, @@ -61,10 +68,13 @@ * This class also provides additional methods the deliver SVG Paint using the * ShapePainter interface. * - * @author Thierry Kormann - * @author For later modifications, see Git history. + *

+ * Original author: Thierry Kormann. + * For later modifications, see Git history. + *

* @version $Id$ */ +@SuppressWarnings("deprecation") public abstract class PaintServer implements SVGConstants, CSSConstants, ErrorConstants { /** @@ -119,10 +129,10 @@ public static ShapePainter convertMarkers(Element e, ShapeNode node, BridgeConte */ public static Marker convertMarker(Element e, Value v, BridgeContext ctx) { - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { + if (v.getPrimitiveType() == Type.IDENT) { return null; // 'none' } else { - String uri = v.getStringValue(); + String uri = v.getURIValue(); Element markerElement = ctx.getReferencedElement(e, uri); if (markerElement == null) { return null; // Missing reference @@ -245,51 +255,57 @@ public static Paint convertFillPaint(Element filledElement, GraphicsNode filledN */ public static Paint convertPaint(Element paintedElement, GraphicsNode paintedNode, Value paintDef, float opacity, BridgeContext ctx) { - if (paintDef.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { + if (paintDef.getCssValueType() == CssType.TYPED) { switch (paintDef.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: return null; // none - - case CSSPrimitiveValue.CSS_RGBCOLOR: - return convertColor(paintDef, opacity); - - case CSSPrimitiveValue.CSS_URI: + case COLOR: + return convertColor(paintDef.getColorValue(), opacity); + case URI: return convertURIPaint(paintedElement, paintedNode, paintDef, opacity, ctx); - default: - throw new IllegalArgumentException("Paint argument is not an appropriate CSS value"); + break; } } else { // List Value v = paintDef.item(0); switch (v.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_RGBCOLOR: - return convertRGBICCColor(paintedElement, v, paintDef.item(1), opacity, ctx); + case COLOR: + switch ((v.getColorValue()).getCSSColorSpace()) { + case ColorValue.RGB_FUNCTION: + return convertRGBICCColor(paintedElement, v, paintDef.item(1), opacity, ctx); + } + break; - case CSSPrimitiveValue.CSS_URI: { + case URI: Paint result = silentConvertURIPaint(paintedElement, paintedNode, v, opacity, ctx); - if (result != null) + if (result != null) { return result; + } v = paintDef.item(1); switch (v.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: return null; // none - - case CSSPrimitiveValue.CSS_RGBCOLOR: - if (paintDef.getLength() == 2) { - return convertColor(v, opacity); - } else { - return convertRGBICCColor(paintedElement, v, paintDef.item(2), opacity, ctx); + case COLOR: + ColorValue color = v.getColorValue(); + switch (color.getCSSColorSpace()) { + case ColorValue.RGB_FUNCTION: + if (paintDef.getLength() == 2) { + return convertColor((RGBColorValue) color, opacity); + } else { + return convertRGBICCColor(paintedElement, v, paintDef.item(2), opacity, ctx); + } } + break; default: - throw new IllegalArgumentException("Paint argument is not an appropriate CSS value"); + break; } - } + default: - // can't be reached - throw new IllegalArgumentException("Paint argument is not an appropriate CSS value"); + break; } } + throw new IllegalArgumentException("Paint argument is not an appropriate CSS value"); } /** @@ -326,7 +342,7 @@ public static Paint silentConvertURIPaint(Element paintedElement, GraphicsNode p public static Paint convertURIPaint(Element paintedElement, GraphicsNode paintedNode, Value paintDef, float opacity, BridgeContext ctx) { - String uri = paintDef.getStringValue(); + String uri = paintDef.getURIValue(); Element paintElement = ctx.getReferencedElement(paintedElement, uri); if (paintElement == null) { return null; // Missing reference @@ -369,14 +385,12 @@ public static Color convertRGBICCColor(Element paintedElement, Value colorDef, V color = convertICCColor(paintedElement, (ICCColor) iccColor, opacity, ctx); } else if (iccColor instanceof ICCNamedColor) { color = convertICCNamedColor(paintedElement, (ICCNamedColor) iccColor, opacity, ctx); - } else if (iccColor instanceof CIELabColor) { - color = convertCIELabColor(paintedElement, (CIELabColor) iccColor, opacity, ctx); } else if (iccColor instanceof DeviceColor) { color = convertDeviceColor(paintedElement, colorDef, (DeviceColor) iccColor, opacity, ctx); } } if (color == null) { - color = convertColor(colorDef, opacity); + color = convertColor(colorDef.getColorValue(), opacity); } return color; } @@ -482,22 +496,6 @@ public static Color convertICCNamedColor(Element e, ICCNamedColor c, float opaci return null; } - /** - * Returns a Color object that corresponds to the input Paint's CIE Lab color - * value. - * - * @param e the element using the color - * @param c the CIE Lab color definition - * @param opacity the opacity - * @param ctx the bridge context to use - */ - public static Color convertCIELabColor(Element e, CIELabColor c, float opacity, BridgeContext ctx) { - CIELabColorSpace cs = new CIELabColorSpace(c.getWhitePoint()); - float[] lab = c.getColorValues(); - Color specColor = cs.toColor(lab[0], lab[1], lab[2], opacity); - return specColor; - } - /** * Returns a Color object that corresponds to the input Paint's device-specific * color value. @@ -509,8 +507,9 @@ public static Color convertCIELabColor(Element e, CIELabColor c, float opacity, * @param ctx the bridge context to use */ public static Color convertDeviceColor(Element e, Value srgb, DeviceColor c, float opacity, BridgeContext ctx) { + ColorValue color = srgb.getColorValue(); if (c.isNChannel()) { - return convertColor(srgb, opacity); // NYI + return convertColor(color, opacity); // NYI } else { if (c.getNumberOfColors() == 4) { DeviceCMYKColorSpace cmykCs = ColorSpaces.getDeviceCMYKColorSpace(); @@ -519,15 +518,16 @@ public static Color convertDeviceColor(Element e, Value srgb, DeviceColor c, flo comps[i] = c.getColor(i); } Color cmyk = new ColorWithAlternatives(cmykCs, comps, opacity, null); - int r = resolveColorComponent(srgb.getRed()); - int g = resolveColorComponent(srgb.getGreen()); - int b = resolveColorComponent(srgb.getBlue()); + RGBColorValue rgb = (RGBColorValue) color; + int r = resolveColorComponent(rgb.getR()); + int g = resolveColorComponent(rgb.getG()); + int b = resolveColorComponent(rgb.getB()); float a = resolveAlphaComponent(c.getAlpha()); Color specColor = new ColorWithAlternatives(r, g, b, Math.round(a * opacity * 255f), new Color[] { cmyk }); return specColor; } else { - return convertColor(srgb, opacity); // NYI + return convertColor(color, opacity); // NYI } } } @@ -538,14 +538,127 @@ public static Color convertDeviceColor(Element e, Value srgb, DeviceColor c, flo * @param c The CSS color to convert. * @param opacity The opacity value (0 <= o <= 1). */ - public static Color convertColor(Value c, float opacity) { - int r = resolveColorComponent(c.getRed()); - int g = resolveColorComponent(c.getGreen()); - int b = resolveColorComponent(c.getBlue()); + public static Color convertColor(ColorValue c, float opacity) { + switch (c.getCSSColorSpace()) { + case ColorValue.RGB_FUNCTION: + return convertColor((RGBColorValue) c, opacity); + case ColorValue.LAB: + case ColorValue.LCH: + throw new UnsupportedOperationException(); + default: + // Color() function + return convertColor((ColorFunction) c, opacity); + } + } + + /** + * Converts the given Value and opacity to a Color object. + * + * @param c The CSS color to convert. + * @param opacity The opacity value (0 <= o <= 1). + */ + public static Color convertColor(RGBColorValue c, float opacity) { + int r = resolveColorComponent(c.getR()); + int g = resolveColorComponent(c.getG()); + int b = resolveColorComponent(c.getB()); float a = resolveAlphaComponent(c.getAlpha()); return new Color(r, g, b, Math.round(a * opacity * 255f)); } + /** + * Converts the given Value and opacity to a Color object. + * + * @param c The CSS color to convert. + * @param opacity The opacity value (0 <= o <= 1). + */ + public static Color convertColor(ColorFunction c, float opacity) { + switch (c.getCSSColorSpace()) { + case ColorValue.CS_DISPLAY_P3: + return convertProfiledColor("color/profiles/Display P3.icc", c, opacity); + case ColorValue.CS_A98_RGB: + return convertProfiledColor("color/profiles/ClayRGB-elle-V4-g22.icc", c, opacity); + case ColorValue.CS_PROPHOTO_RGB: + return convertProfiledColor("color/profiles/LargeRGB-elle-V4-g18.icc", c, opacity); + case ColorValue.CS_REC2020: + return convertProfiledColor("color/profiles/ITU-R_BT2020.icc", c, opacity); + case ColorValue.CS_SRGB_LINEAR: + ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB); + return convert3Color(cs, c, opacity); + case ColorValue.CS_XYZ: + case ColorValue.CS_XYZ_D65: + CSSStyleValueList chs = c.getChannels(); + float[] ch = new float[3]; + ch[0] = resolveColorFunctionComponent(chs.item(0)); + ch[1] = resolveColorFunctionComponent(chs.item(1)); + ch[2] = resolveColorFunctionComponent(chs.item(2)); + float[] xyzd50 = d65xyzToD50(ch); + float a = resolveAlphaComponent(c.getAlpha()); + cs = ColorSpace.getInstance(ColorSpace.CS_CIEXYZ); + return new Color(cs, xyzd50, a * opacity); + case ColorValue.CS_XYZ_D50: + cs = ColorSpace.getInstance(ColorSpace.CS_CIEXYZ); + return convert3Color(cs, c, opacity); + default: + throw new UnsupportedOperationException(); + } + } + + private static Color convertProfiledColor(String profilePath, ColorFunction c, float opacity) { + ICC_Profile icc; + try (InputStream is = PaintServer.class.getResourceAsStream(profilePath)) { + icc = ICC_Profile.getInstance(is); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + ICC_ColorSpace space = new ICC_ColorSpace(icc); + return convert3Color(space, c, opacity); + } + + private static Color convert3Color(ColorSpace space, ColorFunction c, float opacity) { + CSSStyleValueList chs = c.getChannels(); + float[] ch = new float[3]; + ch[0] = resolveColorFunctionComponent(chs.item(0)); + ch[1] = resolveColorFunctionComponent(chs.item(1)); + ch[2] = resolveColorFunctionComponent(chs.item(2)); + float a = resolveAlphaComponent(c.getAlpha()); + return new Color(space, ch, a * opacity); + } + + private static float resolveColorFunctionComponent(NumericValue item) { + float f = item.getFloatValue(); + switch (item.getCSSUnit()) { + case CSSUnit.CSS_NUMBER: + if (f < 0f) { + f = 0f; + } else if (f > 1f) { + f = 1f; + } + return f; + case CSSUnit.CSS_PERCENTAGE: + if (f < 0f) { + f = 0f; + } else if (f > 100f) { + f = 100f; + } + return f * 0.01f; + } + throw new IllegalArgumentException("Invalid color component: " + item.getCssText()); + } + + private static float[] d65xyzToD50(float[] xyz) { + // Chromatic adjustment: D65 to D50, Bradford + // See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html + float[] xyzadj = new float[3]; + xyzadj[0] = (float) (1.0478112436606313d * xyz[0] + 0.022886602481693052d * xyz[1] + - 0.05012697596852886d * xyz[2]); + xyzadj[1] = (float) (0.029542398290574905d * xyz[0] + 0.9904844034904394d * xyz[1] + - 0.017049095628961564d * xyz[2]); + xyzadj[2] = (float) (-0.009234489723309473d * xyz[0] + 0.015043616793498756d * xyz[1] + + 0.7521316354746059d * xyz[2]); + return xyzadj; + } + ///////////////////////////////////////////////////////////////////////// // java.awt.stroke ///////////////////////////////////////////////////////////////////////// @@ -611,7 +724,7 @@ public static Stroke convertStroke(Element e) { */ public static float[] convertStrokeDasharray(Value v) { float[] dasharray = null; - if (v.getCssValueType() == CSSValue.CSS_VALUE_LIST) { + if (v.getCssValueType() == CssType.LIST) { int length = v.getLength(); dasharray = new float[length]; float sum = 0; @@ -646,7 +759,7 @@ public static float convertStrokeMiterlimit(Value v) { * @param v the CSS value describing the linecap property */ public static int convertStrokeLinecap(Value v) { - String s = v.getStringValue(); + String s = v.getIdentifierValue(); switch (s.charAt(0)) { case 'b': return BasicStroke.CAP_BUTT; @@ -665,7 +778,7 @@ public static int convertStrokeLinecap(Value v) { * @param v the CSS value describing the linejoin property */ public static int convertStrokeLinejoin(Value v) { - String s = v.getStringValue(); + String s = v.getIdentifierValue(); switch (s.charAt(0)) { case 'm': return BasicStroke.JOIN_MITER; @@ -689,12 +802,12 @@ public static int convertStrokeLinejoin(Value v) { */ public static int resolveColorComponent(Value v) { float f; - switch (v.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_PERCENTAGE: + switch (v.getCSSUnit()) { + case CSSUnit.CSS_PERCENTAGE: f = v.getFloatValue(); f = (f > 100f) ? 100f : (f < 0f) ? 0f : f; return Math.round(255f * f / 100f); - case CSSPrimitiveValue.CSS_NUMBER: + case CSSUnit.CSS_NUMBER: f = v.getFloatValue(); f = (f > 255f) ? 255f : (f < 0f) ? 0f : f; return Math.round(f); @@ -705,12 +818,12 @@ public static int resolveColorComponent(Value v) { private static float resolveAlphaComponent(Value v) { float f; - switch (v.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_PERCENTAGE: + switch (v.getCSSUnit()) { + case CSSUnit.CSS_PERCENTAGE: f = v.getFloatValue(); f = (f > 100f) ? 100f : (f < 0f) ? 0f : f; return f * 0.01f; - case CSSPrimitiveValue.CSS_NUMBER: + case CSSUnit.CSS_NUMBER: f = v.getFloatValue(); f = (f > 1f) ? 1f : (f < 0f) ? 0f : f; return f; diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGAnimationEngine.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGAnimationEngine.java index 38b03f225..7ca09dc38 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGAnimationEngine.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGAnimationEngine.java @@ -28,11 +28,10 @@ import java.util.LinkedList; import java.util.Set; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.css.CSSPrimitiveValue; import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; import org.w3c.dom.events.EventTarget; import org.w3c.dom.svg.SVGAngle; import org.w3c.dom.svg.SVGLength; @@ -66,11 +65,11 @@ import io.sf.carte.echosvg.anim.values.AnimatableStringValue; import io.sf.carte.echosvg.anim.values.AnimatableValue; import io.sf.carte.echosvg.constants.XMLConstants; +import io.sf.carte.echosvg.css.dom.CSSValue.CssType; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; -import io.sf.carte.echosvg.css.engine.value.FloatValue; -import io.sf.carte.echosvg.css.engine.value.StringValue; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.ValueManager; import io.sf.carte.echosvg.parser.DefaultLengthHandler; @@ -93,8 +92,10 @@ /** * An AnimationEngine for SVG documents. * - * @author Cameron McCormack - * @author For later modifications, see Git history. + *

+ * Original author: Cameron McCormack. + * For later modifications, see Git history. + *

* @version $Id$ */ public class SVGAnimationEngine extends AnimationEngine { @@ -1090,7 +1091,7 @@ protected Value computeValue(CSSStylableElement elt, String pn, Value v) { ValueManager[] vms = cssEngine.getValueManagers(); int idx = cssEngine.getPropertyIndex(pn); if (idx != -1) { - if (v.getCssValueType() == CSSValue.CSS_INHERIT) { + if (v.getPrimitiveType() == Type.INHERIT) { elt = CSSEngine.getParentCSSStylableElement(elt); if (elt != null) { return cssEngine.getComputedStyle(elt, null, idx); @@ -1200,10 +1201,10 @@ public AnimatableValue createValue(AnimationTarget target, String ns, String ln, */ @Override public AnimatableValue createValue(AnimationTarget target, String pn, Value v) { - switch (v.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_PERCENTAGE: + switch (v.getCSSUnit()) { + case CSSUnit.CSS_PERCENTAGE: return new AnimatableNumberOrPercentageValue(target, v.getFloatValue(), true); - case CSSPrimitiveValue.CSS_NUMBER: + case CSSUnit.CSS_NUMBER: return new AnimatableNumberOrPercentageValue(target, v.getFloatValue()); } // XXX Do something better than returning null. @@ -1760,12 +1761,11 @@ protected class AnimatableLengthOrIdentFactory extends CSSValueFactory { @Override protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { - if (v instanceof StringValue) { - return new AnimatableLengthOrIdentValue(target, v.getStringValue()); + if (v.getPrimitiveType() == Type.IDENT) { + return new AnimatableLengthOrIdentValue(target, v.getIdentifierValue()); } short pcInterp = target.getPercentageInterpretation(null, pn, true); - FloatValue fv = (FloatValue) v; - return new AnimatableLengthOrIdentValue(target, fv.getPrimitiveType(), fv.getFloatValue(), pcInterp); + return new AnimatableLengthOrIdentValue(target, v.getCSSUnit(), v.getFloatValue(), pcInterp); } } @@ -1787,11 +1787,10 @@ public AnimatableNumberOrIdentFactory(boolean numericIdents) { @Override protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { - if (v instanceof StringValue) { - return new AnimatableNumberOrIdentValue(target, v.getStringValue()); + if (v.getPrimitiveType() == Type.IDENT) { + return new AnimatableNumberOrIdentValue(target, v.getIdentifierValue()); } - FloatValue fv = (FloatValue) v; - return new AnimatableNumberOrIdentValue(target, fv.getFloatValue(), numericIdents); + return new AnimatableNumberOrIdentValue(target, v.getFloatValue(), numericIdents); } } @@ -1803,24 +1802,23 @@ protected class AnimatableAngleValueFactory extends CSSValueFactory { @Override protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { - FloatValue fv = (FloatValue) v; short unit; - switch (fv.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_NUMBER: - case CSSPrimitiveValue.CSS_DEG: + switch (v.getCSSUnit()) { + case CSSUnit.CSS_NUMBER: + case CSSUnit.CSS_DEG: unit = SVGAngle.SVG_ANGLETYPE_DEG; break; - case CSSPrimitiveValue.CSS_RAD: + case CSSUnit.CSS_RAD: unit = SVGAngle.SVG_ANGLETYPE_RAD; break; - case CSSPrimitiveValue.CSS_GRAD: + case CSSUnit.CSS_GRAD: unit = SVGAngle.SVG_ANGLETYPE_GRAD; break; default: // XXX Do something better than returning null. return null; } - return new AnimatableAngleValue(target, fv.getFloatValue(), unit); + return new AnimatableAngleValue(target, v.getFloatValue(), unit); } } @@ -1832,27 +1830,26 @@ protected class AnimatableAngleOrIdentFactory extends CSSValueFactory { @Override protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { - if (v instanceof StringValue) { - return new AnimatableAngleOrIdentValue(target, v.getStringValue()); + if (v.getPrimitiveType() == Type.IDENT) { + return new AnimatableAngleOrIdentValue(target, v.getIdentifierValue()); } - FloatValue fv = (FloatValue) v; short unit; - switch (fv.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_NUMBER: - case CSSPrimitiveValue.CSS_DEG: + switch (v.getCSSUnit()) { + case CSSUnit.CSS_NUMBER: + case CSSUnit.CSS_DEG: unit = SVGAngle.SVG_ANGLETYPE_DEG; break; - case CSSPrimitiveValue.CSS_RAD: + case CSSUnit.CSS_RAD: unit = SVGAngle.SVG_ANGLETYPE_RAD; break; - case CSSPrimitiveValue.CSS_GRAD: + case CSSUnit.CSS_GRAD: unit = SVGAngle.SVG_ANGLETYPE_GRAD; break; default: // XXX Do something better than returning null. return null; } - return new AnimatableAngleOrIdentValue(target, fv.getFloatValue(), unit); + return new AnimatableAngleOrIdentValue(target, v.getFloatValue(), unit); } } @@ -1891,35 +1888,32 @@ protected AnimatablePaintValue createColorPaintValue(AnimationTarget t, Color c) @Override protected AnimatableValue createAnimatableValue(AnimationTarget target, String pn, Value v) { - if (v.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { + if (v.getCssValueType() != CssType.LIST) { switch (v.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: return AnimatablePaintValue.createNonePaintValue(target); - case CSSPrimitiveValue.CSS_RGBCOLOR: { + case COLOR: { Paint p = PaintServer.convertPaint(target.getElement(), null, v, 1.0f, ctx); return createColorPaintValue(target, (Color) p); } - case CSSPrimitiveValue.CSS_URI: - return AnimatablePaintValue.createURIPaintValue(target, v.getStringValue()); + case URI: + return AnimatablePaintValue.createURIPaintValue(target, v.getURIValue()); } } else { Value v1 = v.item(0); switch (v1.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_RGBCOLOR: { + case COLOR: Paint p = PaintServer.convertPaint(target.getElement(), null, v, 1.0f, ctx); return createColorPaintValue(target, (Color) p); - } - case CSSPrimitiveValue.CSS_URI: { + case URI: Value v2 = v.item(1); switch (v2.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_IDENT: - return AnimatablePaintValue.createURINonePaintValue(target, v1.getStringValue()); - case CSSPrimitiveValue.CSS_RGBCOLOR: { - Paint p = PaintServer.convertPaint(target.getElement(), null, v.item(1), 1.0f, ctx); + case IDENT: + return AnimatablePaintValue.createURINonePaintValue(target, v1.getIdentifierValue()); + case COLOR: + p = PaintServer.convertPaint(target.getElement(), null, v.item(1), 1.0f, ctx); return createColorPaintValue(target, (Color) p); } - } - } } } // XXX Indicate that the specified Value wasn't a Color? diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGGVTFont.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGGVTFont.java index ba1ac0c2f..43b9a29f2 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGGVTFont.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGGVTFont.java @@ -117,7 +117,7 @@ public SVGGVTFont(float fontSize, GVTFontFace fontFace, String[] glyphUnicodes, this.language = XMLSupport.getXMLLang(textElement); Value v = CSSUtilities.getComputedStyle(textElement, SVGCSSEngine.WRITING_MODE_INDEX); - if (v.getStringValue().startsWith(CSS_TB_VALUE)) { + if (v.getIdentifierValue().startsWith(CSS_TB_VALUE)) { // top to bottom, so set orientation to "v" this.orientation = SVG_V_VALUE; } else { diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGTextElementBridge.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGTextElementBridge.java index e6d2b21fa..ee9cd9aa7 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGTextElementBridge.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/SVGTextElementBridge.java @@ -40,10 +40,9 @@ import java.util.Set; import java.util.WeakHashMap; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.Element; import org.w3c.dom.Node; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import org.w3c.dom.events.Event; import org.w3c.dom.events.EventListener; import org.w3c.dom.events.MutationEvent; @@ -52,6 +51,7 @@ import org.w3c.dom.svg.SVGTextContentElement; import org.w3c.dom.svg.SVGTextPositioningElement; +import io.sf.carte.doc.style.css.property.NumberValue; import io.sf.carte.echosvg.anim.dom.AbstractSVGAnimatedLength; import io.sf.carte.echosvg.anim.dom.AnimatedLiveAttributeValue; import io.sf.carte.echosvg.anim.dom.SVGOMAnimatedEnumeration; @@ -61,11 +61,11 @@ import io.sf.carte.echosvg.anim.dom.SVGOMTextPositioningElement; import io.sf.carte.echosvg.bridge.StrokingTextPainter.TextRun; import io.sf.carte.echosvg.constants.XMLConstants; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngineEvent; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.SVGCSSEngine; import io.sf.carte.echosvg.css.engine.StyleMap; -import io.sf.carte.echosvg.css.engine.value.ListValue; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.dom.events.NodeEventTarget; import io.sf.carte.echosvg.dom.svg.LiveAttributeException; @@ -1379,7 +1379,8 @@ protected List getFontList(BridgeContext ctx, Element element, Map getAttributeMap(BridgeContext ctx, Element elem // Unicode-bidi mode Value val = CSSUtilities.getComputedStyle(element, SVGCSSEngine.UNICODE_BIDI_INDEX); - s = val.getStringValue(); + s = val.getIdentifierValue(); if (s.charAt(0) == 'n') { if (bidiLevel != null) result.put(TextAttribute.BIDI_EMBEDDING, bidiLevel); @@ -1498,7 +1499,7 @@ protected Map getAttributeMap(BridgeContext ctx, Element elem // normal writing direction for a string/substring. val = CSSUtilities.getComputedStyle(element, SVGCSSEngine.DIRECTION_INDEX); - String rs = val.getStringValue(); + String rs = val.getIdentifierValue(); int cbidi = 0; if (bidiLevel != null) cbidi = bidiLevel; @@ -1537,7 +1538,7 @@ protected Map getAttributeMap(BridgeContext ctx, Element elem // Writing mode val = CSSUtilities.getComputedStyle(element, SVGCSSEngine.WRITING_MODE_INDEX); - s = val.getStringValue(); + s = val.getIdentifierValue(); switch (s.charAt(0)) { case 'l': result.put(GVTAttributedCharacterIterator.TextAttribute.WRITING_MODE, @@ -1556,53 +1557,58 @@ protected Map getAttributeMap(BridgeContext ctx, Element elem // glyph-orientation-vertical val = CSSUtilities.getComputedStyle(element, SVGCSSEngine.GLYPH_ORIENTATION_VERTICAL_INDEX); - int primitiveType = val.getPrimitiveType(); + Type primitiveType = val.getPrimitiveType(); switch (primitiveType) { - case CSSPrimitiveValue.CSS_IDENT: // auto + case IDENT: // auto result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION, GVTAttributedCharacterIterator.TextAttribute.ORIENTATION_AUTO); break; - case CSSPrimitiveValue.CSS_DEG: - result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION, - GVTAttributedCharacterIterator.TextAttribute.ORIENTATION_ANGLE); - result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION_ANGLE, val.getFloatValue()); - break; - case CSSPrimitiveValue.CSS_RAD: - result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION, - GVTAttributedCharacterIterator.TextAttribute.ORIENTATION_ANGLE); - result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION_ANGLE, - (float) Math.toDegrees(val.getFloatValue())); - break; - case CSSPrimitiveValue.CSS_GRAD: - result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION, - GVTAttributedCharacterIterator.TextAttribute.ORIENTATION_ANGLE); - result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION_ANGLE, - val.getFloatValue() * 9 / 5); + case NUMERIC: + switch (val.getCSSUnit()) { + case CSSUnit.CSS_DEG: + case CSSUnit.CSS_NUMBER: + result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION, + GVTAttributedCharacterIterator.TextAttribute.ORIENTATION_ANGLE); + result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION_ANGLE, val.getFloatValue()); + break; + case CSSUnit.CSS_RAD: + result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION, + GVTAttributedCharacterIterator.TextAttribute.ORIENTATION_ANGLE); + result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION_ANGLE, + (float) Math.toDegrees(val.getFloatValue())); + break; + case CSSUnit.CSS_GRAD: + result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION, + GVTAttributedCharacterIterator.TextAttribute.ORIENTATION_ANGLE); + result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION_ANGLE, + val.getFloatValue() * 9 / 5); + break; + default: + if (CSSUnit.isAngleUnitType(val.getCSSUnit())) { + float f = NumberValue.floatValueConversion(val.getFloatValue(), val.getCSSUnit(), CSSUnit.CSS_DEG); + result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION, + GVTAttributedCharacterIterator.TextAttribute.ORIENTATION_ANGLE); + result.put(GVTAttributedCharacterIterator.TextAttribute.VERTICAL_ORIENTATION_ANGLE, f); + break; + } + throw new IllegalStateException("unexpected value (V):" + val.getCssText()); + } break; default: - // Cannot happen throw new IllegalStateException("unexpected primitiveType (V):" + primitiveType); } // glyph-orientation-horizontal val = CSSUtilities.getComputedStyle(element, SVGCSSEngine.GLYPH_ORIENTATION_HORIZONTAL_INDEX); - primitiveType = val.getPrimitiveType(); - switch (primitiveType) { - case CSSPrimitiveValue.CSS_DEG: + short unit = val.getCSSUnit(); + if (unit == CSSUnit.CSS_NUMBER || unit == CSSUnit.CSS_DEG) { result.put(GVTAttributedCharacterIterator.TextAttribute.HORIZONTAL_ORIENTATION_ANGLE, val.getFloatValue()); - break; - case CSSPrimitiveValue.CSS_RAD: - result.put(GVTAttributedCharacterIterator.TextAttribute.HORIZONTAL_ORIENTATION_ANGLE, - (float) Math.toDegrees(val.getFloatValue())); - break; - case CSSPrimitiveValue.CSS_GRAD: - result.put(GVTAttributedCharacterIterator.TextAttribute.HORIZONTAL_ORIENTATION_ANGLE, - val.getFloatValue() * 9 / 5); - break; - default: - // Cannot happen - throw new IllegalStateException("unexpected primitiveType (H):" + primitiveType); + } else if (CSSUnit.isAngleUnitType(unit)) { + float f = NumberValue.floatValueConversion(val.getFloatValue(), val.getCSSUnit(), CSSUnit.CSS_DEG); + result.put(GVTAttributedCharacterIterator.TextAttribute.HORIZONTAL_ORIENTATION_ANGLE, f); + } else { + throw new IllegalStateException("unexpected value (H):" + val.getCssText()); } // text spacing properties... @@ -1730,13 +1736,11 @@ public void setDecorationTextPaintInfo(TextPaintInfo pi, Element element) { Value val = CSSUtilities.getComputedStyle(element, SVGCSSEngine.TEXT_DECORATION_INDEX); switch (val.getCssValueType()) { - case CSSValue.CSS_VALUE_LIST: - ListValue lst = (ListValue) val; - - int len = lst.getLength(); + case LIST: + int len = val.getLength(); for (int i = 0; i < len; i++) { - Value v = lst.item(i); - String s = v.getStringValue(); + Value v = val.item(i); + String s = v.getIdentifierValue(); switch (s.charAt(0)) { case 'u': if (pi.fillPaint != null) { diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/TextUtilities.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/TextUtilities.java index a72e9b321..95f0b5e34 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/TextUtilities.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/TextUtilities.java @@ -24,8 +24,8 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; -import org.w3c.dom.css.CSSPrimitiveValue; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.SVGCSSEngine; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.util.CSSConstants; @@ -135,7 +135,7 @@ public static Float convertFontSize(Element e) { */ public static Float convertFontStyle(Element e) { Value v = CSSUtilities.getComputedStyle(e, SVGCSSEngine.FONT_STYLE_INDEX); - switch (v.getStringValue().charAt(0)) { + switch (v.getIdentifierValue().charAt(0)) { case 'n': return TextAttribute.POSTURE_REGULAR; default: @@ -150,7 +150,7 @@ public static Float convertFontStyle(Element e) { */ public static Float convertFontStretch(Element e) { Value v = CSSUtilities.getComputedStyle(e, SVGCSSEngine.FONT_STRETCH_INDEX); - String s = v.getStringValue(); + String s = v.getIdentifierValue(); switch (s.charAt(0)) { case 'u': if (s.charAt(6) == 'c') { @@ -234,7 +234,7 @@ public static Float convertFontWeight(Element e) { */ public static TextNode.Anchor convertTextAnchor(Element e) { Value v = CSSUtilities.getComputedStyle(e, SVGCSSEngine.TEXT_ANCHOR_INDEX); - switch (v.getStringValue().charAt(0)) { + switch (v.getIdentifierValue().charAt(0)) { case 's': return TextNode.Anchor.START; case 'm': @@ -252,8 +252,8 @@ public static TextNode.Anchor convertTextAnchor(Element e) { */ public static Object convertBaselineShift(Element e) { Value v = CSSUtilities.getComputedStyle(e, SVGCSSEngine.BASELINE_SHIFT_INDEX); - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { - String s = v.getStringValue(); + if (v.getPrimitiveType() == Type.IDENT) { + String s = v.getIdentifierValue(); switch (s.charAt(2)) { case 'p': // suPerscript return TextAttribute.SUPERSCRIPT_SUPER; @@ -276,7 +276,7 @@ public static Object convertBaselineShift(Element e) { */ public static Float convertKerning(Element e) { Value v = CSSUtilities.getComputedStyle(e, SVGCSSEngine.KERNING_INDEX); - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { + if (v.getPrimitiveType() == Type.IDENT) { return null; } return v.getFloatValue(); @@ -290,7 +290,7 @@ public static Float convertKerning(Element e) { */ public static Float convertLetterSpacing(Element e) { Value v = CSSUtilities.getComputedStyle(e, SVGCSSEngine.LETTER_SPACING_INDEX); - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { + if (v.getPrimitiveType() == Type.IDENT) { return null; } return v.getFloatValue(); @@ -304,7 +304,7 @@ public static Float convertLetterSpacing(Element e) { */ public static Float convertWordSpacing(Element e) { Value v = CSSUtilities.getComputedStyle(e, SVGCSSEngine.WORD_SPACING_INDEX); - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { + if (v.getPrimitiveType() == Type.IDENT) { return null; } return v.getFloatValue(); diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/Viewport.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/Viewport.java index 987dffd53..612c859b7 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/Viewport.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/Viewport.java @@ -22,20 +22,12 @@ /** * Defines a viewport. * - * @author Thierry Kormann - * @author For later modifications, see Git history. + *

+ * Original author: Thierry Kormann. + * For later modifications, see Git history. + *

* @version $Id$ */ -public interface Viewport { - - /** - * Returns the width of this viewport. - */ - float getWidth(); - - /** - * Returns the height of this viewport. - */ - float getHeight(); +public interface Viewport extends io.sf.carte.echosvg.css.Viewport { } diff --git a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/svg12/SVGSolidColorElementBridge.java b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/svg12/SVGSolidColorElementBridge.java index 5cce3d879..b18cae155 100644 --- a/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/svg12/SVGSolidColorElementBridge.java +++ b/echosvg-bridge/src/main/java/io/sf/carte/echosvg/bridge/svg12/SVGSolidColorElementBridge.java @@ -24,7 +24,6 @@ import java.util.Map; import org.w3c.dom.Element; -import org.w3c.dom.css.CSSValue; import io.sf.carte.echosvg.anim.dom.SVGOMDocument; import io.sf.carte.echosvg.bridge.AnimatableGenericSVGBridge; @@ -34,6 +33,7 @@ import io.sf.carte.echosvg.bridge.ErrorConstants; import io.sf.carte.echosvg.bridge.PaintBridge; import io.sf.carte.echosvg.bridge.PaintServer; +import io.sf.carte.echosvg.css.dom.CSSValue.CssType; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -48,8 +48,10 @@ /** * Bridge class for a regular polygon element. * - * @author Thomas Deweese - * @author For later modifications, see Git history. + *

+ * Original author: Thomas Deweese. + * For later modifications, see Git history. + *

* @version $Id$ */ public class SVGSolidColorElementBridge extends AnimatableGenericSVGBridge implements PaintBridge { @@ -143,8 +145,8 @@ protected static Color extractColor(Element paintElement, float opacity, BridgeC StyleMap sm = ((CSSStylableElement) paintElement).getComputedStyleMap(null); if (!sm.isNullCascaded(pidx)) { // It was explicit... - if (colorDef.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) { - return PaintServer.convertColor(colorDef, opacity); + if (colorDef.getCssValueType() != CssType.LIST) { + return PaintServer.convertColor(colorDef.getColorValue(), opacity); } else { return PaintServer.convertRGBICCColor(paintElement, colorDef.item(0), colorDef.item(1), opacity, ctx); diff --git a/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/ClayRGB-elle-V4-g22.icc b/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/ClayRGB-elle-V4-g22.icc new file mode 100644 index 0000000000000000000000000000000000000000..8c9e01cbaf764681e42a8313f360582202af2c52 GIT binary patch literal 1164 zcmZ`&O=}ZT6g_EDx{2r_3zaTrQG=DFlQeBncP5l72tv{pD=wVOOeTSu$uKh-i+@2u z5Wz(ke&EinTM_&Tg1Qj#2e=d5Xc^CaGj)PA?=kP4ym#-p_uYE}lpeaK7nK@-=f`1p ztF7JKyQM9B$2F zxe8}9t}y~~g|v1sL=26-4K%TV8u4bvt)a)eF?`0+a9&x)^t=q6)2FxGSo|Dv*_;vj zTwVH1n2X8Xqvf(Bg^H-p+%X?44Xp7bm`VTT_ z4jPgOgO-MdAZm!Ht;wmtrQ~+*dx0#Md1BbAIxo9Qjd z`w15<+f>bDF-2JsAKmCwx_kS@(LPO!S*=d}IC_-4D_`EM?!N|SyQ%@vm(7_P)qcrC z8Z#`wB@-)q7886x95Coo#5KVMhtC9O9KNzO>!}239*8BasAh><#B!!DU+CjK;A2FNF{h#i<OH=m+rBie6NDDE$HjFIJ}iw=3>N@WFfYn>YV?Z+2#Z?AgnTvG||}xLy?0 zmJGG}c1;ca!Z0Q=juF7LLVtPXRUNcyy`f6Q64kes0WMF#2>hI`mdonLxzQ@@e*E^~ z;PlV&{Ohl`%DZ8#)ebEnqqw|g`9Vb9CBNH_eBpoOiROlIwjdnvfaED*JK_0Qlkgki zUf*@7Sr?AlR+r5E$Xi{rMSf3y9@J}P@_<~h6FwAfCVV99_WC?qZ1RQqw%1tUxIlk| zD(Yxp8Z{^w+{I(fh}unNOmZT(es(gvs76>utt0ZOd1tNTHhA)VfwcJ$eXwraR1$Zt0$Gs;hubo6c9d z>i8P!E7cL4T_QUg$Rkr7jx|-m8)J4)yV&|l$mFTwJO@PHSB;(!ZI%`zf-9uwI$-V* zb4WD-YmDczV{NEGrR&;f-qj-*SMjN{?!lAdn~}}e)eH&}*)W;(Q0n&>NUui8J*Mkk}u=tz{#N?%z~WOs^UdG2(iat4VOO@3kC&vz zPpN_izb#4UUvfBq#y?}9q8pFfc6cZImEt7>Udvw8e$G>SZ1d1r$S!nmo)BgKzvX^u zh<{B_WNYeXPdnIKungfXb^{_!i^gP%_4xa~(?tf}fT?(QQ&8k`SMc0|X$STu{D%HV p7y2=sPSlrjlRo=Ce`|U(O=K`ll#o(W8#c>i9vQf}dyH3M)j#}T$^ZZW literal 0 HcmV?d00001 diff --git a/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/NOTICE.txt b/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/NOTICE.txt new file mode 100644 index 000000000..529f0b486 --- /dev/null +++ b/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/color/profiles/NOTICE.txt @@ -0,0 +1,7 @@ +The files that have "elle" in the filename are licensed as shown in the +'ElleStone-legalcode.txt' file. + +The Display P3 profile was made by Apple and was obtained from color.org (ICC). + +The profile for the ITU-R Recommendation BT.2020 was also obtained from +color.org (ICC). diff --git a/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/resources/Messages.properties b/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/resources/Messages.properties index 8030d99c7..77e5fca02 100644 --- a/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/resources/Messages.properties +++ b/echosvg-bridge/src/main/resources/io/sf/carte/echosvg/bridge/resources/Messages.properties @@ -39,6 +39,11 @@ length.negative = \ {0}:{1}\n\ The attribute "{3}" of the element <{2}> cannot be negative +css.badValue = \ +{0}:{1}\n\ +Error in a computed value for the element <{2}>:\n\ +{3} + css.length.negative = \ {0}:{1}\n\ The CSS property "{3}" found on the element <{2}> cannot be negative diff --git a/echosvg-css/build.gradle b/echosvg-css/build.gradle index e1b82473b..a1f3d484b 100644 --- a/echosvg-css/build.gradle +++ b/echosvg-css/build.gradle @@ -5,6 +5,7 @@ plugins { dependencies { api project(':echosvg-util') implementation project(':echosvg-i18n') + api "io.sf.w3:domview-api:${domViewVersion}" api "io.sf.carte:svgom-api:${svgomVersion}" api "io.sf.carte:css4j:${css4jVersion}" testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}" diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/Viewport.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/Viewport.java new file mode 100644 index 000000000..fa8ef9425 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/Viewport.java @@ -0,0 +1,39 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ + +package io.sf.carte.echosvg.css; + +/** + * A viewport. + * + * @version $Id$ + */ +public interface Viewport { + + /** + * @return the width of this viewport. + */ + float getWidth(); + + /** + * @return the height of this viewport. + */ + float getHeight(); + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMComputedStyle.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMComputedStyle.java index 780ff0ea9..4cfa82f2c 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMComputedStyle.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMComputedStyle.java @@ -21,10 +21,9 @@ import java.util.HashMap; import java.util.Map; +import org.w3c.css.om.CSSRule; +import org.w3c.css.om.CSSStyleDeclaration; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSRule; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; @@ -33,8 +32,10 @@ /** * This class represents the computed style of an element. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class CSSOMComputedStyle implements CSSStyleDeclaration { @@ -108,12 +109,12 @@ public String getPropertyValue(String propertyName) { return v.getCssText(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#getPropertyCSSValue(String)}. - */ @Override - public CSSValue getPropertyCSSValue(String propertyName) { + public CSSValue getCSSStyleValue(String propertyName) { + return getCSSValue(propertyName); + } + + public CSSValue getCSSValue(String propertyName) { CSSValue result = values.get(propertyName); if (result == null) { int idx = cssEngine.getPropertyIndex(propertyName); diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGColor.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGColor.java index bd78f4f54..63c91db66 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGColor.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGColor.java @@ -18,33 +18,33 @@ */ package io.sf.carte.echosvg.css.dom; -import java.util.ArrayList; - +import org.w3c.css.om.typed.CSSColorValue; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; -import org.w3c.dom.css.Counter; import org.w3c.dom.css.RGBColor; -import org.w3c.dom.css.Rect; import org.w3c.dom.svg.SVGColor; import org.w3c.dom.svg.SVGICCColor; import org.w3c.dom.svg.SVGNumber; import org.w3c.dom.svg.SVGNumberList; -import io.sf.carte.echosvg.css.engine.value.FloatValue; +import io.sf.carte.echosvg.css.engine.value.ColorFunction; +import io.sf.carte.echosvg.css.engine.value.ColorValue; +import io.sf.carte.echosvg.css.engine.value.NumericValue; import io.sf.carte.echosvg.css.engine.value.RGBColorValue; import io.sf.carte.echosvg.css.engine.value.Value; -import io.sf.carte.echosvg.css.engine.value.svg.ICCColor; +import io.sf.carte.echosvg.css.engine.value.ValueModificationHandler; import io.sf.carte.echosvg.util.CSSConstants; /** * This class implements the {@link SVGColor} interface. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ -public class CSSOMSVGColor implements SVGColor, RGBColor, SVGICCColor, SVGNumberList { +@SuppressWarnings("removal") +public class CSSOMSVGColor implements CSSValue, CSSColorValue, SVGICCColor, SVGNumberList { /** * The associated value. @@ -54,27 +54,7 @@ public class CSSOMSVGColor implements SVGColor, RGBColor, SVGICCColor, SVGNumber /** * The modifications handler. */ - protected ModificationHandler handler; - - /** - * The red component, if this value is a RGBColor. - */ - protected RedComponent redComponent; - - /** - * The green component, if this value is a RGBColor. - */ - protected GreenComponent greenComponent; - - /** - * The blue component, if this value is a RGBColor. - */ - protected BlueComponent blueComponent; - - /** - * To store the ICC color list. - */ - protected ArrayList iccColors; + protected ValueModificationHandler handler; /** * Creates a new CSSOMSVGColor. @@ -86,110 +66,166 @@ public CSSOMSVGColor(ValueProvider vp) { /** * Sets the modification handler of this value. */ - public void setModificationHandler(ModificationHandler h) { + public void setModificationHandler(ValueModificationHandler h) { handler = h; } - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#getCssText()}. - */ @Override public String getCssText() { return valueProvider.getValue().getCssText(); } - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ @Override public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - iccColors = null; - handler.textChanged(cssText); - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); + } + + @Override + public String toString() { + return getCssText(); + } + + @Override + public CssType getCssValueType() { + return CssType.TYPED; + } + + @Override + public Type getPrimitiveType() { + return valueProvider.getValue().getPrimitiveType(); + } + + @Override + public float getFloatValue() { + return valueProvider.getValue().getFloatValue(); + } + + @Override + public int getLength() { + return valueProvider.getValue().getLength(); + } + + @Override + public Value item(int index) { + valueProvider.getValue().setModificationHandler(handler); + return valueProvider.getValue().item(index); } - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#getCssValueType()}. - */ @Override - public short getCssValueType() { - return CSS_CUSTOM; + public String getIdentifierValue() throws DOMException { + return valueProvider.getValue().getIdentifierValue(); + } + + @Override + public String getStringValue() throws DOMException { + return valueProvider.getValue().getStringValue(); + } + + @Override + public String getURIValue() throws DOMException { + return valueProvider.getValue().getURIValue(); } /** * DOM: Implements {@link org.w3c.dom.svg.SVGColor#getColorType()}. */ - @Override + @SuppressWarnings("deprecation") public short getColorType() { Value value = valueProvider.getValue(); - int cssValueType = value.getCssValueType(); - switch (cssValueType) { - case CSSValue.CSS_PRIMITIVE_VALUE: - int primitiveType = value.getPrimitiveType(); - switch (primitiveType) { - case CSSPrimitiveValue.CSS_IDENT: { - if (value.getStringValue().equalsIgnoreCase(CSSConstants.CSS_CURRENTCOLOR_VALUE)) - return SVG_COLORTYPE_CURRENTCOLOR; - return SVG_COLORTYPE_RGBCOLOR; - } - case CSSPrimitiveValue.CSS_RGBCOLOR: - return SVG_COLORTYPE_RGBCOLOR; + switch (value.getCssValueType()) { + case TYPED: + switch (value.getPrimitiveType()) { + case IDENT: { + if (CSSConstants.CSS_CURRENTCOLOR_VALUE.equalsIgnoreCase(value.getIdentifierValue())) + return SVGColor.SVG_COLORTYPE_CURRENTCOLOR; + return SVGColor.SVG_COLORTYPE_RGBCOLOR; + } + case COLOR: + ColorValue color = value.getColorValue(); + switch (color.getCSSColorSpace()) { + case ColorValue.RGB_FUNCTION: + return SVGColor.SVG_COLORTYPE_RGBCOLOR; + default: + throw new IllegalStateException("Found unexpected color type:" + color.getCSSColorSpace()); + } + default: + // there was no case for this primitiveType, prevent throwing the other + // exception + throw new IllegalStateException("Found unexpected PrimitiveType:" + value.getPrimitiveType()); } - // there was no case for this primitiveType, prevent throwing the other - // exception - throw new IllegalStateException("Found unexpected PrimitiveType:" + primitiveType); - case CSSValue.CSS_VALUE_LIST: - return SVG_COLORTYPE_RGBCOLOR_ICCCOLOR; + case LIST: + return SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR; + default: + // should not happen + throw new IllegalStateException("Found unexpected CssValueType:" + value.getCssValueType()); } - // should not happen - throw new IllegalStateException("Found unexpected CssValueType:" + cssValueType); } /** * DOM: Implements {@link org.w3c.dom.svg.SVGColor#getRGBColor()}. */ - @Override public RGBColor getRGBColor() { - return this; + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Legacy value API not supported."); } /** - * Returns the RGBColor value for this SVGColor. For the SVG 1.1 ECMAScript + * Returns the CSSColorValue value for this SVGColor. For the SVG ECMAScript * binding. */ - public RGBColor getRgbColor() { - return this; + public ColorValue getCSSColorValue() { + valueProvider.getValue().setModificationHandler(handler); + return valueProvider.getValue().getColorValue(); + } + + public String getCSSColorSpace() { + return getCSSColorValue().getCSSColorSpace(); + } + + public NumericValue getAlpha() { + return getCSSColorValue().getAlpha(); } /** - * DOM: Implements {@link org.w3c.dom.svg.SVGColor#setRGBColor(String)}. + * Sets the alpha channel as a percentage. + * + * @param alpha the alpha channel as a percentage. */ - @Override - public void setRGBColor(String color) { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - handler.rgbColorChanged(color); + public void setAlpha(double alpha) { + getCSSColorValue().setAlpha(alpha); + } + + public NumericValue getR() { + return getRGBColorValue().getR(); + } + + RGBColorValue getRGBColorValue() { + ColorValue color = getCSSColorValue(); + if (ColorValue.RGB_FUNCTION.equals(color.getCSSColorSpace())) { + return (RGBColorValue) color; } + throw new DOMException(DOMException.INVALID_ACCESS_ERR, "Not an RGB color."); + } + + public NumericValue getG() { + return getRGBColorValue().getG(); + } + + public NumericValue getB() { + return getRGBColorValue().getB(); } /** - * DOM: Implements {@link org.w3c.dom.svg.SVGColor#getICCColor()}. + * DOM: Implements {@link org.w3c.dom.svg.SVGColor#setRGBColor(String)}. */ - @Override - public SVGICCColor getICCColor() { - return this; + public void setRGBColor(String color) { + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** - * Returns the SVGICCColor value of this SVGColor. For the SVG 1.1 ECMAScript - * binding. + * DOM: Implements {@link org.w3c.dom.svg.SVGColor#getICCColor()}. */ - public SVGICCColor getIccColor() { + public SVGICCColor getICCColor() { return this; } @@ -197,80 +233,23 @@ public SVGICCColor getIccColor() { * DOM: Implements * {@link org.w3c.dom.svg.SVGColor#setRGBColorICCColor(String,String)}. */ - @Override public void setRGBColorICCColor(String rgb, String icc) { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - iccColors = null; - handler.rgbColorICCColorChanged(rgb, icc); - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** * DOM: Implements * {@link org.w3c.dom.svg.SVGColor#setColor(short,String,String)}. */ - @Override public void setColor(short type, String rgb, String icc) { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - iccColors = null; - handler.colorChanged(type, rgb, icc); - } - } - - // RGBColor /////////////////////////////////////////////////// - - /** - * DOM: Implements {@link org.w3c.dom.css.RGBColor#getRed()}. - */ - @Override - public CSSPrimitiveValue getRed() { - valueProvider.getValue().getRed(); - if (redComponent == null) { - redComponent = new RedComponent(); - } - return redComponent; - } - - /** - * DOM: Implements {@link org.w3c.dom.css.RGBColor#getGreen()}. - */ - @Override - public CSSPrimitiveValue getGreen() { - valueProvider.getValue().getGreen(); - if (greenComponent == null) { - greenComponent = new GreenComponent(); - } - return greenComponent; - } - - /** - * DOM: Implements {@link org.w3c.dom.css.RGBColor#getBlue()}. - */ - @Override - public CSSPrimitiveValue getBlue() { - valueProvider.getValue().getBlue(); - if (blueComponent == null) { - blueComponent = new BlueComponent(); - } - return blueComponent; + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } // SVGICCColor ////////////////////////////////////////////////// - /** - * DOM: Implements {@link org.w3c.dom.svg.SVGICCColor#getColorProfile()}. - */ @Override public String getColorProfile() { - if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { - throw new DOMException(DOMException.SYNTAX_ERR, ""); - } - Value value = valueProvider.getValue(); - return ((ICCColor) value.item(1)).getColorProfile(); + return getCSSColorValue().getCSSColorSpace(); } /** @@ -278,11 +257,7 @@ public String getColorProfile() { */ @Override public void setColorProfile(String colorProfile) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - handler.colorProfileChanged(colorProfile); - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** @@ -300,11 +275,11 @@ public SVGNumberList getColors() { */ @Override public int getNumberOfItems() { - if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { - throw new DOMException(DOMException.SYNTAX_ERR, ""); + ColorValue value = getCSSColorValue(); + if (!(value instanceof ColorFunction)) { + throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); } - Value value = valueProvider.getValue(); - return ((ICCColor) value.item(1)).getNumberOfColors(); + return ((ColorFunction) value).getChannels().getLength(); } /** @@ -312,12 +287,7 @@ public int getNumberOfItems() { */ @Override public void clear() throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - iccColors = null; - handler.colorsCleared(); - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** @@ -325,40 +295,28 @@ public void clear() throws DOMException { */ @Override public SVGNumber initialize(SVGNumber newItem) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - float f = newItem.getValue(); - iccColors = new ArrayList<>(); - SVGNumber result = new ColorNumber(f); - iccColors.add(result); - handler.colorsInitialized(f); - return result; - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** * DOM: Implements {@link SVGNumberList#getItem(int)}. */ + @SuppressWarnings("deprecation") @Override public SVGNumber getItem(int index) throws DOMException { - if (getColorType() != SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { + if (getColorType() != SVGColor.SVG_COLORTYPE_RGBCOLOR_ICCCOLOR) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } int n = getNumberOfItems(); if (index < 0 || index >= n) { throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); } - if (iccColors == null) { - iccColors = new ArrayList<>(n); - for (int i = iccColors.size(); i < n; i++) { - iccColors.add(null); - } + ColorValue value = getCSSColorValue(); + if (!(value instanceof ColorFunction)) { + throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); } - Value value = valueProvider.getValue().item(1); - float f = ((ICCColor) value).getColor(index); + float f = ((ColorFunction) value).getChannels().item(index).getFloatValue(); SVGNumber result = new ColorNumber(f); - iccColors.set(index, result); return result; } @@ -367,25 +325,7 @@ public SVGNumber getItem(int index) throws DOMException { */ @Override public SVGNumber insertItemBefore(SVGNumber newItem, int index) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - int n = getNumberOfItems(); - if (index < 0 || index > n) { - throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); - } - if (iccColors == null) { - iccColors = new ArrayList<>(n); - for (int i = iccColors.size(); i < n; i++) { - iccColors.add(null); - } - } - float f = newItem.getValue(); - SVGNumber result = new ColorNumber(f); - iccColors.add(index, result); - handler.colorInsertedBefore(f, index); - return result; - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** @@ -393,25 +333,7 @@ public SVGNumber insertItemBefore(SVGNumber newItem, int index) throws DOMExcept */ @Override public SVGNumber replaceItem(SVGNumber newItem, int index) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - int n = getNumberOfItems(); - if (index < 0 || index >= n) { - throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); - } - if (iccColors == null) { - iccColors = new ArrayList<>(n); - for (int i = iccColors.size(); i < n; i++) { - iccColors.add(null); - } - } - float f = newItem.getValue(); - SVGNumber result = new ColorNumber(f); - iccColors.set(index, result); - handler.colorReplaced(f, index); - return result; - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** @@ -419,24 +341,7 @@ public SVGNumber replaceItem(SVGNumber newItem, int index) throws DOMException { */ @Override public SVGNumber removeItem(int index) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - int n = getNumberOfItems(); - if (index < 0 || index >= n) { - throw new DOMException(DOMException.INDEX_SIZE_ERR, ""); - } - SVGNumber result = null; - if (iccColors != null) { - result = iccColors.get(index); - } - if (result == null) { - Value value = valueProvider.getValue().item(1); - result = new ColorNumber(((ICCColor) value).getColor(index)); - } - handler.colorRemoved(index); - return result; - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** @@ -444,22 +349,7 @@ public SVGNumber removeItem(int index) throws DOMException { */ @Override public SVGNumber appendItem(SVGNumber newItem) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - if (iccColors == null) { - int n = getNumberOfItems(); - iccColors = new ArrayList<>(n); - for (int i = 0; i < n; i++) { - iccColors.add(null); - } - } - float f = newItem.getValue(); - SVGNumber result = new ColorNumber(f); - iccColors.add(result); - handler.colorAppend(f); - return result; - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } /** @@ -484,15 +374,7 @@ public ColorNumber(float f) { */ @Override public float getValue() { - if (iccColors == null) { - return value; - } - int idx = iccColors.indexOf(this); - if (idx == -1) { - return value; - } - Value value = valueProvider.getValue().item(1); - return ((ICCColor) value).getColor(idx); + return value; } /** @@ -500,19 +382,7 @@ public float getValue() { */ @Override public void setValue(float f) { - value = f; - if (iccColors == null) { - return; - } - int idx = iccColors.indexOf(this); - if (idx == -1) { - return; - } - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - handler.colorReplaced(f, idx); - } + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } } @@ -529,720 +399,4 @@ public interface ValueProvider { } - /** - * To manage the modifications on a CSS value. - */ - public interface ModificationHandler { - - /** - * Called when the value text has changed. - */ - void textChanged(String text) throws DOMException; - - /** - * Called when the red value text has changed. - */ - void redTextChanged(String text) throws DOMException; - - /** - * Called when the red float value has changed. - */ - void redFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the green value text has changed. - */ - void greenTextChanged(String text) throws DOMException; - - /** - * Called when the green float value has changed. - */ - void greenFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the blue value text has changed. - */ - void blueTextChanged(String text) throws DOMException; - - /** - * Called when the blue float value has changed. - */ - void blueFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the alpha value text has changed. - */ - void alphaTextChanged(String text) throws DOMException; - - /** - * Called when the alpha float value has changed. - */ - void alphaFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the RGBColor text has changed. - */ - void rgbColorChanged(String text) throws DOMException; - - /** - * Called when the RGBColor and the ICCColor text has changed. - */ - void rgbColorICCColorChanged(String rgb, String icc) throws DOMException; - - /** - * Called when the SVGColor has changed. - */ - void colorChanged(short type, String rgb, String icc) throws DOMException; - - /** - * Called when the ICC color profile has changed. - */ - void colorProfileChanged(String cp) throws DOMException; - - /** - * Called when the ICC colors has changed. - */ - void colorsCleared() throws DOMException; - - /** - * Called when the ICC colors has been initialized. - */ - void colorsInitialized(float f) throws DOMException; - - /** - * Called when the ICC color has been inserted. - */ - void colorInsertedBefore(float f, int idx) throws DOMException; - - /** - * Called when the ICC color has been replaced. - */ - void colorReplaced(float f, int idx) throws DOMException; - - /** - * Called when the ICC color has been removed. - */ - void colorRemoved(int idx) throws DOMException; - - /** - * Called when the ICC color has been append. - */ - void colorAppend(float f) throws DOMException; - - } - - /** - * Provides an abstract implementation of a ModificationHandler. - */ - public abstract class AbstractModificationHandler implements ModificationHandler { - - /** - * Returns the associated value. - */ - protected abstract Value getValue(); - - /** - * Called when the red value text has changed. - */ - @Override - public void redTextChanged(String text) throws DOMException { - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR: - text = RGBColorValue.toString(text, getValue().getGreen().getCssText(), - getValue().getBlue().getCssText(), getValue().getAlpha().getCssText()); - break; - - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - text = RGBColorValue.toString(text, getValue().item(0).getGreen().getCssText(), - getValue().item(0).getBlue().getCssText(), getValue().item(0).getAlpha().getCssText()) + ' ' - + getValue().item(1).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - /** - * Called when the red float value has changed. - */ - @Override - public void redFloatValueChanged(short unit, float fValue) throws DOMException { - redTextChanged(FloatValue.getCssText(unit, fValue)); - } - - /** - * Called when the green value text has changed. - */ - @Override - public void greenTextChanged(String text) throws DOMException { - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR: - text = RGBColorValue.toString(getValue().getRed().getCssText(), text, getValue().getBlue().getCssText(), - getValue().getAlpha().getCssText()); - break; - - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - text = RGBColorValue.toString(getValue().item(0).getRed().getCssText(), text, - getValue().item(0).getBlue().getCssText(), getValue().item(0).getAlpha().getCssText()) + ' ' - + getValue().item(1).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - /** - * Called when the green float value has changed. - */ - @Override - public void greenFloatValueChanged(short unit, float fValue) throws DOMException { - greenTextChanged(FloatValue.getCssText(unit, fValue)); - } - - /** - * Called when the blue value text has changed. - */ - @Override - public void blueTextChanged(String text) throws DOMException { - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR: - text = RGBColorValue.toString(getValue().getRed().getCssText(), getValue().getGreen().getCssText(), - text, getValue().getAlpha().getCssText()); - break; - - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - text = RGBColorValue.toString(getValue().item(0).getRed().getCssText(), - getValue().item(0).getGreen().getCssText(), text, getValue().item(0).getAlpha().getCssText()) - + ' ' + getValue().item(1).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - /** - * Called when the blue float value has changed. - */ - @Override - public void blueFloatValueChanged(short unit, float fValue) throws DOMException { - blueTextChanged(FloatValue.getCssText(unit, fValue)); - } - - @Override - public void alphaTextChanged(String text) throws DOMException { - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR: - text = RGBColorValue.toString(getValue().getRed().getCssText(), getValue().getGreen().getCssText(), - getValue().getBlue().getCssText(), text); - break; - - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - text = RGBColorValue.toString(getValue().item(0).getRed().getCssText(), - getValue().item(0).getGreen().getCssText(), getValue().item(0).getBlue().getCssText(), text) - + ' ' + getValue().item(1).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - @Override - public void alphaFloatValueChanged(short unit, float fValue) throws DOMException { - alphaTextChanged(FloatValue.getCssText(unit, fValue)); - } - - /** - * Called when the RGBColor text has changed. - */ - @Override - public void rgbColorChanged(String text) throws DOMException { - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR: - break; - - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - text += getValue().item(1).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - /** - * Called when the RGBColor and the ICCColor text has changed. - */ - @Override - public void rgbColorICCColorChanged(String rgb, String icc) throws DOMException { - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - textChanged(rgb + ' ' + icc); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the SVGColor has changed. - */ - @Override - public void colorChanged(short type, String rgb, String icc) throws DOMException { - switch (type) { - case SVG_COLORTYPE_CURRENTCOLOR: - textChanged(CSSConstants.CSS_CURRENTCOLOR_VALUE); - break; - - case SVG_COLORTYPE_RGBCOLOR: - textChanged(rgb); - break; - - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - textChanged(rgb + ' ' + icc); - break; - - default: - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - } - - /** - * Called when the ICC color profile has changed. - */ - @Override - public void colorProfileChanged(String cp) throws DOMException { - Value value = getValue(); - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(value.item(0).getCssText()); - sb.append(" icc-color("); - sb.append(cp); - ICCColor iccc = (ICCColor) value.item(1); - for (int i = 0; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC colors has changed. - */ - @Override - public void colorsCleared() throws DOMException { - Value value = getValue(); - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(value.item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) value.item(1); - sb.append(iccc.getColorProfile()); - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC colors has been initialized. - */ - @Override - public void colorsInitialized(float f) throws DOMException { - Value value = getValue(); - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(value.item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) value.item(1); - sb.append(iccc.getColorProfile()); - sb.append(','); - sb.append(f); - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC color has been inserted. - */ - @Override - public void colorInsertedBefore(float f, int idx) throws DOMException { - Value value = getValue(); - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(value.item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) value.item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - for (int i = idx; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC color has been replaced. - */ - @Override - public void colorReplaced(float f, int idx) throws DOMException { - Value value = getValue(); - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(value.item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) value.item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - for (int i = idx + 1; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC color has been removed. - */ - @Override - public void colorRemoved(int idx) throws DOMException { - Value value = getValue(); - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(value.item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) value.item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - for (int i = idx + 1; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC color has been append. - */ - @Override - public void colorAppend(float f) throws DOMException { - Value value = getValue(); - switch (getColorType()) { - case SVG_COLORTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(value.item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) value.item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - } - - /** - * To store a component. - */ - protected abstract class AbstractComponent implements CSSPrimitiveValue { - - /** - * The returns the actual value of this component. - */ - protected abstract Value getValue(); - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#getCssText()}. - */ - @Override - public String getCssText() { - return getValue().getCssText(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#getCssValueType()}. - */ - @Override - public short getCssValueType() { - return getValue().getCssValueType(); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getPrimitiveType()}. - */ - @Override - public short getPrimitiveType() { - return getValue().getPrimitiveType(); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getFloatValue(short)}. - */ - @Override - public float getFloatValue(short unitType) throws DOMException { - return CSSOMValue.convertFloatValue(unitType, getValue()); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getStringValue()}. - */ - @Override - public String getStringValue() throws DOMException { - return valueProvider.getValue().getStringValue(); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getCounterValue()}. - */ - @Override - public Counter getCounterValue() throws DOMException { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getRectValue()}. - */ - @Override - public Rect getRectValue() throws DOMException { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}. - */ - @Override - public RGBColor getRGBColorValue() throws DOMException { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - // CSSValueList /////////////////////////////////////////////////////// - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValueList#getLength()}. - */ - public int getLength() { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValueList#item(int)}. - */ - public CSSValue item(int index) { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - } - - /** - * To store a Float component. - */ - protected abstract class FloatComponent extends AbstractComponent { - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setStringValue(short,String)}. - */ - @Override - public void setStringValue(short stringType, String stringValue) throws DOMException { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - } - - /** - * To represents a red component. - */ - protected class RedComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getRed(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.redTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.redFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a green component. - */ - protected class GreenComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getGreen(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.greenTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.greenFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a blue component. - */ - protected class BlueComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getBlue(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.blueTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.blueFloatValueChanged(unitType, floatValue); - } - } - - } - } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGComputedStyle.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGComputedStyle.java index c7a77277c..1dd5ee7de 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGComputedStyle.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGComputedStyle.java @@ -18,8 +18,6 @@ */ package io.sf.carte.echosvg.css.dom; -import org.w3c.dom.css.CSSValue; - import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.SVGCSSEngine; diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGPaint.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGPaint.java index 2e9a92cb1..6ff79fcbf 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGPaint.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGPaint.java @@ -19,24 +19,25 @@ package io.sf.carte.echosvg.css.dom; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import org.w3c.dom.svg.SVGPaint; -import io.sf.carte.echosvg.css.engine.value.FloatValue; -import io.sf.carte.echosvg.css.engine.value.RGBColorValue; +import io.sf.carte.echosvg.css.engine.value.AbstractValueModificationHandler; +import io.sf.carte.echosvg.css.engine.value.ColorValue; import io.sf.carte.echosvg.css.engine.value.Value; -import io.sf.carte.echosvg.css.engine.value.svg.ICCColor; +import io.sf.carte.echosvg.css.engine.value.ValueModificationHandler; import io.sf.carte.echosvg.util.CSSConstants; /** * This class implements the {@link SVGPaint} interface. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ -public class CSSOMSVGPaint extends CSSOMSVGColor implements SVGPaint { +@SuppressWarnings("deprecation") +public class CSSOMSVGPaint extends CSSOMSVGColor { /** * Creates a new CSSOMSVGPaint. @@ -49,7 +50,7 @@ public CSSOMSVGPaint(ValueProvider vp) { * Sets the modification handler of this value. */ @Override - public void setModificationHandler(ModificationHandler h) { + public void setModificationHandler(ValueModificationHandler h) { if (!(h instanceof PaintModificationHandler)) { throw new IllegalArgumentException(); } @@ -67,74 +68,96 @@ public short getColorType() { /** * DOM: Implements {@link org.w3c.dom.svg.SVGPaint#getPaintType()}. */ - @Override public short getPaintType() { Value value = valueProvider.getValue(); switch (value.getCssValueType()) { - case CSSValue.CSS_PRIMITIVE_VALUE: + case TYPED: switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_IDENT: { - String str = value.getStringValue(); + case IDENT: + String str = value.getIdentifierValue(); if (str.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { - return SVG_PAINTTYPE_NONE; + return SVGPaint.SVG_PAINTTYPE_NONE; } else if (str.equalsIgnoreCase(CSSConstants.CSS_CURRENTCOLOR_VALUE)) { - return SVG_PAINTTYPE_CURRENTCOLOR; + return SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR; } - return SVG_PAINTTYPE_RGBCOLOR; - } - case CSSPrimitiveValue.CSS_RGBCOLOR: - return SVG_PAINTTYPE_RGBCOLOR; - - case CSSPrimitiveValue.CSS_URI: - return SVG_PAINTTYPE_URI; + return SVGPaint.SVG_PAINTTYPE_RGBCOLOR; + case COLOR: + ColorValue color = value.getColorValue(); + switch (color.getCSSColorSpace()) { + case ColorValue.RGB_FUNCTION: + return SVGPaint.SVG_PAINTTYPE_RGBCOLOR; + default: + break; + } + break; + case URI: + return SVGPaint.SVG_PAINTTYPE_URI; } break; - case CSSValue.CSS_VALUE_LIST: + case LIST: Value v0 = value.item(0); Value v1 = value.item(1); switch (v0.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_IDENT: - return SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR; - case CSSPrimitiveValue.CSS_URI: - if (v1.getCssValueType() == CSSValue.CSS_VALUE_LIST) - // Should probably check this more deeply... - return SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR; + case IDENT: + return SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR; + case URI: + if (v1.getCssValueType() == Value.CssType.LIST) + // FIXME: Should probably check this more deeply... + return SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR; switch (v1.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_IDENT: { - String str = v1.getStringValue(); + case IDENT: + String str = v1.getIdentifierValue(); if (str.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { - return SVG_PAINTTYPE_URI_NONE; + return SVGPaint.SVG_PAINTTYPE_URI_NONE; } else if (str.equalsIgnoreCase(CSSConstants.CSS_CURRENTCOLOR_VALUE)) { - return SVG_PAINTTYPE_URI_CURRENTCOLOR; + return SVGPaint.SVG_PAINTTYPE_URI_CURRENTCOLOR; + } + return SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR; + case COLOR: + ColorValue color = v1.getColorValue(); + switch (color.getCSSColorSpace()) { + case ColorValue.RGB_FUNCTION: + return SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR; + default: + break; } - return SVG_PAINTTYPE_URI_RGBCOLOR; - } - case CSSPrimitiveValue.CSS_RGBCOLOR: - return SVG_PAINTTYPE_URI_RGBCOLOR; } - case CSSPrimitiveValue.CSS_RGBCOLOR: - return SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR; + break; + case COLOR: + ColorValue color = v0.getColorValue(); + switch (color.getCSSColorSpace()) { + case ColorValue.RGB_FUNCTION: + return SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR; + default: + break; + } } + } - return SVG_PAINTTYPE_UNKNOWN; + + return SVGPaint.SVG_PAINTTYPE_UNKNOWN; + } + + @Override + public String getURIValue() throws DOMException { + return getUri(); } /** * DOM: Implements {@link org.w3c.dom.svg.SVGPaint#getUri()}. */ - @Override public String getUri() { switch (getPaintType()) { - case SVG_PAINTTYPE_URI: - return valueProvider.getValue().getStringValue(); + case SVGPaint.SVG_PAINTTYPE_URI: + return valueProvider.getValue().getURIValue(); - case SVG_PAINTTYPE_URI_NONE: - case SVG_PAINTTYPE_URI_CURRENTCOLOR: - case SVG_PAINTTYPE_URI_RGBCOLOR: - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: + case SVGPaint.SVG_PAINTTYPE_URI_NONE: + case SVGPaint.SVG_PAINTTYPE_URI_CURRENTCOLOR: + case SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR: + case SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: return valueProvider.getValue().item(0).getStringValue(); } throw new InternalError(); @@ -143,12 +166,11 @@ public String getUri() { /** * DOM: Implements {@link org.w3c.dom.svg.SVGPaint#setUri(String)}. */ - @Override public void setUri(String uri) { if (handler == null) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } else { - ((PaintModificationHandler) handler).uriChanged(uri); + ((PaintModificationHandler) handler).uriValueChanged(uri); } } @@ -156,7 +178,6 @@ public void setUri(String uri) { * DOM: Implements * {@link org.w3c.dom.svg.SVGPaint#setPaint(short,String,String,String)}. */ - @Override public void setPaint(short paintType, String uri, String rgbColor, String iccColor) { if (handler == null) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); @@ -168,12 +189,12 @@ public void setPaint(short paintType, String uri, String rgbColor, String iccCol /** * To manage the modifications on a SVGPaint value. */ - public interface PaintModificationHandler extends ModificationHandler { + public interface PaintModificationHandler extends ValueModificationHandler { /** * Called when the URI has been modified. */ - void uriChanged(String uri); + void uriValueChanged(String uri); /** * Called when the paint value has beem modified. @@ -185,559 +206,15 @@ public interface PaintModificationHandler extends ModificationHandler { /** * Provides an abstract implementation of a PaintModificationHandler. */ - public abstract class AbstractModificationHandler implements PaintModificationHandler { - - /** - * Returns the associated value. - */ - protected abstract Value getValue(); - - /** - * Called when the red value text has changed. - */ - @Override - public void redTextChanged(String text) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR: - text = RGBColorValue.toString(text, getValue().getGreen().getCssText(), - getValue().getBlue().getCssText(), getValue().getAlpha().getCssText()); - break; - - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - text = RGBColorValue.toString(text, getValue().item(0).getGreen().getCssText(), - getValue().item(0).getBlue().getCssText(), getValue().item(0).getAlpha().getCssText()) + ' ' - + getValue().item(1).getCssText(); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR: - text = getValue().item(0).getCssText() + ' ' - + RGBColorValue.toString(text, getValue().item(1).getGreen().getCssText(), - getValue().item(1).getBlue().getCssText(), getValue().item(1).getAlpha().getCssText()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - text = getValue().item(0).getCssText() + ' ' - + RGBColorValue.toString(text, getValue().item(1).getGreen().getCssText(), - getValue().item(1).getBlue().getCssText(), getValue().item(1).getAlpha().getCssText()) - + ' ' + getValue().item(2).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - /** - * Called when the red float value has changed. - */ - @Override - public void redFloatValueChanged(short unit, float value) throws DOMException { - redTextChanged(FloatValue.getCssText(unit, value)); - } - - /** - * Called when the green value text has changed. - */ - @Override - public void greenTextChanged(String text) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR: - text = RGBColorValue.toString(getValue().getRed().getCssText(), text, getValue().getBlue().getCssText(), - getValue().getAlpha().getCssText()); - break; - - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - text = RGBColorValue.toString(getValue().item(0).getRed().getCssText(), text, - getValue().item(0).getBlue().getCssText(), getValue().item(0).getAlpha().getCssText()) + ' ' - + getValue().item(1).getCssText(); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR: - text = getValue().item(0).getCssText() + ' ' - + RGBColorValue.toString(getValue().item(1).getRed().getCssText(), text, - getValue().item(1).getBlue().getCssText(), getValue().item(1).getAlpha().getCssText()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - text = getValue().item(0).getCssText() + ' ' - + RGBColorValue.toString(getValue().item(1).getRed().getCssText(), text, - getValue().item(1).getBlue().getCssText(), getValue().item(1).getAlpha().getCssText()) - + ' ' + getValue().item(2).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - /** - * Called when the green float value has changed. - */ - @Override - public void greenFloatValueChanged(short unit, float value) throws DOMException { - greenTextChanged(FloatValue.getCssText(unit, value)); - } - - /** - * Called when the blue value text has changed. - */ - @Override - public void blueTextChanged(String text) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR: - text = RGBColorValue.toString(getValue().getRed().getCssText(), getValue().getGreen().getCssText(), - text, getValue().getAlpha().getCssText()); - break; - - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - text = RGBColorValue.toString(getValue().item(0).getRed().getCssText(), - getValue().item(0).getGreen().getCssText(), text, getValue().item(0).getAlpha().getCssText()) - + ' ' + getValue().item(1).getCssText(); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR: - text = getValue().item(0).getCssText() + ' ' - + RGBColorValue.toString(getValue().item(1).getRed().getCssText(), - getValue().item(1).getGreen().getCssText(), text, - getValue().item(1).getAlpha().getCssText()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - text = getValue().item(0).getCssText() + ' ' - + RGBColorValue.toString(getValue().item(1).getRed().getCssText(), - getValue().item(1).getGreen().getCssText(), text, - getValue().item(1).getAlpha().getCssText()) - + ' ' + getValue().item(2).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - /** - * Called when the blue float value has changed. - */ - @Override - public void blueFloatValueChanged(short unit, float value) throws DOMException { - blueTextChanged(FloatValue.getCssText(unit, value)); - } - - @Override - public void alphaTextChanged(String text) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR: - text = RGBColorValue.toString(getValue().getRed().getCssText(), getValue().getGreen().getCssText(), - getValue().getBlue().getCssText(), text); - break; - - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - text = RGBColorValue.toString(getValue().item(0).getRed().getCssText(), - getValue().item(0).getGreen().getCssText(), getValue().item(0).getBlue().getCssText(), text) - + ' ' + getValue().item(1).getCssText(); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR: - text = getValue().item(0).getCssText() + ' ' - + RGBColorValue.toString(getValue().item(1).getRed().getCssText(), - getValue().item(1).getGreen().getCssText(), getValue().item(1).getBlue().getCssText(), - text); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - text = getValue().item(0).getCssText() + ' ' - + RGBColorValue.toString(getValue().item(1).getRed().getCssText(), - getValue().item(1).getGreen().getCssText(), getValue().item(1).getBlue().getCssText(), - text) - + ' ' + getValue().item(2).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - @Override - public void alphaFloatValueChanged(short unit, float value) throws DOMException { - alphaTextChanged(FloatValue.getCssText(unit, value)); - } - - /** - * Called when the RGBColor text has changed. - */ - @Override - public void rgbColorChanged(String text) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR: - break; - - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - text += getValue().item(1).getCssText(); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR: - text = getValue().item(0).getCssText() + ' ' + text; - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - text = getValue().item(0).getCssText() + ' ' + text + ' ' + getValue().item(2).getCssText(); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - textChanged(text); - } - - /** - * Called when the RGBColor and the ICCColor text has changed. - */ - @Override - public void rgbColorICCColorChanged(String rgb, String icc) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - textChanged(rgb + ' ' + icc); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - textChanged(getValue().item(0).getCssText() + ' ' + rgb + ' ' + icc); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the SVGColor has changed. - */ - @Override - public void colorChanged(short type, String rgb, String icc) throws DOMException { - switch (type) { - case SVG_PAINTTYPE_CURRENTCOLOR: - textChanged("currentcolor"); - break; - - case SVG_PAINTTYPE_RGBCOLOR: - textChanged(rgb); - break; - - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - textChanged(rgb + ' ' + icc); - break; - - default: - throw new DOMException(DOMException.NOT_SUPPORTED_ERR, ""); - } - } - - /** - * Called when the ICC color profile has changed. - */ - @Override - public void colorProfileChanged(String cp) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(" icc-color("); - sb.append(cp); - ICCColor iccc = (ICCColor) getValue().item(1); - for (int i = 0; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(' '); - sb.append(getValue().item(1).getCssText()); - sb.append(" icc-color("); - sb.append(cp); - iccc = (ICCColor) getValue().item(1); - for (int i = 0; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC colors has changed. - */ - @Override - public void colorsCleared() throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - sb.append(')'); - textChanged(sb.toString()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(' '); - sb.append(getValue().item(1).getCssText()); - sb.append(" icc-color("); - iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC colors has been initialized. - */ - @Override - public void colorsInitialized(float f) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - sb.append(','); - sb.append(f); - sb.append(')'); - textChanged(sb.toString()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(' '); - sb.append(getValue().item(1).getCssText()); - sb.append(" icc-color("); - iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - sb.append(','); - sb.append(f); - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC color has been inserted. - */ - @Override - public void colorInsertedBefore(float f, int idx) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - for (int i = idx; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(' '); - sb.append(getValue().item(1).getCssText()); - sb.append(" icc-color("); - iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - for (int i = idx; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC color has been replaced. - */ - @Override - public void colorReplaced(float f, int idx) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - for (int i = idx + 1; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(' '); - sb.append(getValue().item(1).getCssText()); - sb.append(" icc-color("); - iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - for (int i = idx + 1; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC color has been removed. - */ - @Override - public void colorRemoved(int idx) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - for (int i = idx + 1; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(' '); - sb.append(getValue().item(1).getCssText()); - sb.append(" icc-color("); - iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < idx; i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - for (int i = idx + 1; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } - - /** - * Called when the ICC color has been append. - */ - @Override - public void colorAppend(float f) throws DOMException { - switch (getPaintType()) { - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - StringBuilder sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(" icc-color("); - ICCColor iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - sb.append(')'); - textChanged(sb.toString()); - break; - - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - sb = new StringBuilder(getValue().item(0).getCssText()); - sb.append(' '); - sb.append(getValue().item(1).getCssText()); - sb.append(" icc-color("); - iccc = (ICCColor) getValue().item(1); - sb.append(iccc.getColorProfile()); - for (int i = 0; i < iccc.getLength(); i++) { - sb.append(','); - sb.append(iccc.getColor(i)); - } - sb.append(','); - sb.append(f); - sb.append(')'); - textChanged(sb.toString()); - break; - - default: - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - } + public abstract class AbstractModificationHandler extends AbstractValueModificationHandler + implements PaintModificationHandler { /** * Called when the URI has been modified. */ @Override - public void uriChanged(String uri) { - textChanged("url(" + uri + ") none"); + public void uriValueChanged(String uri) { + setPropertyText("url(" + uri + ") none"); } /** @@ -746,40 +223,40 @@ public void uriChanged(String uri) { @Override public void paintChanged(short type, String uri, String rgb, String icc) { switch (type) { - case SVG_PAINTTYPE_NONE: - textChanged("none"); + case SVGPaint.SVG_PAINTTYPE_NONE: + setPropertyText("none"); break; - case SVG_PAINTTYPE_CURRENTCOLOR: - textChanged("currentcolor"); + case SVGPaint.SVG_PAINTTYPE_CURRENTCOLOR: + setPropertyText("currentcolor"); break; - case SVG_PAINTTYPE_RGBCOLOR: - textChanged(rgb); + case SVGPaint.SVG_PAINTTYPE_RGBCOLOR: + setPropertyText(rgb); break; - case SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: - textChanged(rgb + ' ' + icc); + case SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR: + setPropertyText(rgb + ' ' + icc); break; - case SVG_PAINTTYPE_URI: - textChanged("url(" + uri + ')'); + case SVGPaint.SVG_PAINTTYPE_URI: + setPropertyText("url(" + uri + ')'); break; - case SVG_PAINTTYPE_URI_NONE: - textChanged("url(" + uri + ") none"); + case SVGPaint.SVG_PAINTTYPE_URI_NONE: + setPropertyText("url(" + uri + ") none"); break; - case SVG_PAINTTYPE_URI_CURRENTCOLOR: - textChanged("url(" + uri + ") currentcolor"); + case SVGPaint.SVG_PAINTTYPE_URI_CURRENTCOLOR: + setPropertyText("url(" + uri + ") currentcolor"); break; - case SVG_PAINTTYPE_URI_RGBCOLOR: - textChanged("url(" + uri + ") " + rgb); + case SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR: + setPropertyText("url(" + uri + ") " + rgb); break; - case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: - textChanged("url(" + uri + ") " + rgb + ' ' + icc); + case SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: + setPropertyText("url(" + uri + ") " + rgb + ' ' + icc); } } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGStyleDeclaration.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGStyleDeclaration.java index 0ac061739..d942e17e5 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGStyleDeclaration.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGStyleDeclaration.java @@ -18,12 +18,12 @@ */ package io.sf.carte.echosvg.css.dom; +import org.w3c.css.om.CSSRule; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSRule; -import org.w3c.dom.css.CSSValue; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.SVGCSSEngine; +import io.sf.carte.echosvg.css.engine.value.AbstractValueModificationHandler; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.svg.SVGColorManager; import io.sf.carte.echosvg.css.engine.value.svg.SVGPaintManager; @@ -31,8 +31,10 @@ /** * This class represents a SVG style declaration. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class CSSOMSVGStyleDeclaration extends CSSOMStyleDeclaration { @@ -94,14 +96,14 @@ public class StyleDeclarationColorValue extends CSSOMSVGColor implements CSSOMSV public StyleDeclarationColorValue(String prop) { super(null); valueProvider = this; - setModificationHandler(new AbstractModificationHandler() { + setModificationHandler(new AbstractValueModificationHandler() { @Override protected Value getValue() { return StyleDeclarationColorValue.this.getValue(); } @Override - public void textChanged(String text) throws DOMException { + protected void setPropertyText(String text) throws DOMException { if (handler == null) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } @@ -148,7 +150,7 @@ protected Value getValue() { } @Override - public void textChanged(String text) throws DOMException { + protected void setPropertyText(String text) throws DOMException { if (handler == null) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGViewCSS.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGViewCSS.java index a7aca0835..e6d45f4e8 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGViewCSS.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMSVGViewCSS.java @@ -18,8 +18,8 @@ */ package io.sf.carte.echosvg.css.dom; +import org.w3c.css.om.CSSStyleDeclaration; import org.w3c.dom.Element; -import org.w3c.dom.css.CSSStyleDeclaration; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMStyleDeclaration.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMStyleDeclaration.java index 75d3f324e..1ed9456d5 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMStyleDeclaration.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMStyleDeclaration.java @@ -21,18 +21,20 @@ import java.util.HashMap; import java.util.Map; +import org.w3c.css.om.CSSRule; +import org.w3c.css.om.CSSStyleDeclaration; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSRule; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; +import io.sf.carte.echosvg.css.engine.value.AbstractValueModificationHandler; import io.sf.carte.echosvg.css.engine.value.Value; /** * This class represents a style declaration. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class CSSOMStyleDeclaration implements CSSStyleDeclaration { @@ -72,19 +74,11 @@ public void setModificationHandler(ModificationHandler h) { handler = h; } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#getCssText()}. - */ @Override public String getCssText() { return valueProvider.getText(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#setCssText(String)}. - */ @Override public void setCssText(String cssText) throws DOMException { if (handler == null) { @@ -95,10 +89,6 @@ public void setCssText(String cssText) throws DOMException { } } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#getPropertyValue(String)}. - */ @Override public String getPropertyValue(String propertyName) { Value value = valueProvider.getValue(propertyName); @@ -108,12 +98,8 @@ public String getPropertyValue(String propertyName) { return value.getCssText(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#getPropertyCSSValue(String)}. - */ @Override - public CSSValue getPropertyCSSValue(String propertyName) { + public CSSValue getCSSStyleValue(String propertyName) { Value value = valueProvider.getValue(propertyName); if (value == null) { return null; @@ -121,10 +107,6 @@ public CSSValue getPropertyCSSValue(String propertyName) { return getCSSValue(propertyName); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#removeProperty(String)}. - */ @Override public String removeProperty(String propertyName) throws DOMException { String result = getPropertyValue(propertyName); @@ -141,19 +123,11 @@ public String removeProperty(String propertyName) throws DOMException { return result; } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#getPropertyPriority(String)}. - */ @Override public String getPropertyPriority(String propertyName) { return (valueProvider.isImportant(propertyName)) ? "important" : ""; } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#setProperty(String,String,String)}. - */ @Override public void setProperty(String propertyName, String value, String prio) throws DOMException { if (handler == null) { @@ -163,10 +137,6 @@ public void setProperty(String propertyName, String value, String prio) throws D } } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#getLength()}. - */ @Override public int getLength() { return valueProvider.getLength(); @@ -180,10 +150,6 @@ public String item(int index) { return valueProvider.item(index); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSStyleDeclaration#getParentRule()}. - */ @Override public CSSRule getParentRule() { return parentRule; @@ -247,12 +213,12 @@ public interface ValueProvider { } /** - * To manage the modifications on a CSS value. + * To manage the modifications on a CSS style declaration. */ public interface ModificationHandler { /** - * Called when the value text has changed. + * Called when the declaration text has changed. */ void textChanged(String text) throws DOMException; @@ -284,14 +250,14 @@ public class StyleDeclarationValue extends CSSOMValue implements CSSOMValue.Valu public StyleDeclarationValue(String prop) { super(null); this.valueProvider = this; - this.setModificationHandler(new AbstractModificationHandler() { + this.setModificationHandler(new AbstractValueModificationHandler() { @Override protected Value getValue() { return StyleDeclarationValue.this.getValue(); } @Override - public void textChanged(String text) throws DOMException { + protected void setPropertyText(String text) throws DOMException { if (values == null || StyleDeclarationValue.this.handler == null) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMValue.java index 2b111d58b..1c089c02f 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMValue.java @@ -18,30 +18,25 @@ */ package io.sf.carte.echosvg.css.dom; +import org.w3c.css.om.typed.CSSCounterValue; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; -import org.w3c.dom.css.CSSValueList; -import org.w3c.dom.css.Counter; -import org.w3c.dom.css.RGBColor; -import org.w3c.dom.css.Rect; -import io.sf.carte.echosvg.css.engine.value.FloatValue; -import io.sf.carte.echosvg.css.engine.value.ListValue; -import io.sf.carte.echosvg.css.engine.value.RGBColorValue; -import io.sf.carte.echosvg.css.engine.value.StringValue; +import io.sf.carte.echosvg.css.engine.value.ColorValue; +import io.sf.carte.echosvg.css.engine.value.RectValue; import io.sf.carte.echosvg.css.engine.value.Value; +import io.sf.carte.echosvg.css.engine.value.ValueModificationHandler; /** - * This class implements the {@link org.w3c.dom.css.CSSValue}, - * {@link org.w3c.dom.css.CSSPrimitiveValue}, - * {@link org.w3c.dom.css.CSSValueList} interfaces. - * - * @author Stephane Hillion - * @author For later modifications, see Git history. + * This class implements the {@link org.w3c.css.om.typed.CSSStyleValue} + * interface. + *

+ * Original author Stephane Hillion + *

+ * * @version $Id$ */ -public class CSSOMValue implements CSSPrimitiveValue, CSSValueList, Counter, Rect, RGBColor { +public class CSSOMValue implements Value { /** * The associated value. @@ -51,52 +46,7 @@ public class CSSOMValue implements CSSPrimitiveValue, CSSValueList, Counter, Rec /** * The modifications handler. */ - protected ModificationHandler handler; - - /** - * The left component, if this value is a Rect. - */ - protected LeftComponent leftComponent; - - /** - * The right component, if this value is a Rect. - */ - protected RightComponent rightComponent; - - /** - * The bottom component, if this value is a Rect. - */ - protected BottomComponent bottomComponent; - - /** - * The top component, if this value is a Rect. - */ - protected TopComponent topComponent; - - /** - * The red component, if this value is a RGBColor. - */ - protected RedComponent redComponent; - - /** - * The green component, if this value is a RGBColor. - */ - protected GreenComponent greenComponent; - - /** - * The blue component, if this value is a RGBColor. - */ - protected BlueComponent blueComponent; - - /** - * The alpha component, if this value is a RGBColor. - */ - protected AlphaComponent alphaComponent; - - /** - * The list items. - */ - protected CSSValue[] items; + protected ValueModificationHandler handler; /** * Creates a new CSSOMValue. @@ -108,7 +58,7 @@ public CSSOMValue(ValueProvider vp) { /** * Sets the modification handler of this value. */ - public void setModificationHandler(ModificationHandler h) { + public void setModificationHandler(ValueModificationHandler h) { handler = h; } @@ -120,55 +70,38 @@ public String getCssText() { return valueProvider.getValue().getCssText(); } - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ @Override public void setCssText(String cssText) throws DOMException { if (handler == null) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } else { - handler.textChanged(cssText); + valueProvider.getValue().setCssText(cssText); + handler.valueChanged(valueProvider.getValue()); } } - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#getCssValueType()}. - */ @Override - public short getCssValueType() { + public CssType getCssValueType() { return valueProvider.getValue().getCssValueType(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getPrimitiveType()}. - */ @Override - public short getPrimitiveType() { + public Type getPrimitiveType() { return valueProvider.getValue().getPrimitiveType(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { + public void setFloatValue(float floatValue) throws DOMException { if (handler == null) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); } else { - handler.floatValueChanged(unitType, floatValue); + handler.valueChanged(this); } } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getFloatValue(short)}. - */ @Override - public float getFloatValue(short unitType) throws DOMException { - return convertFloatValue(unitType, valueProvider.getValue()); + public float getFloatValue() throws DOMException { + return valueProvider.getValue().getFloatValue(); } /** @@ -176,39 +109,39 @@ public float getFloatValue(short unitType) throws DOMException { */ public static float convertFloatValue(short unitType, Value value) { switch (unitType) { - case CSSPrimitiveValue.CSS_NUMBER: - case CSSPrimitiveValue.CSS_PERCENTAGE: - case CSSPrimitiveValue.CSS_EMS: - case CSSPrimitiveValue.CSS_EXS: - case CSSPrimitiveValue.CSS_DIMENSION: - case CSSPrimitiveValue.CSS_PX: - if (value.getPrimitiveType() == unitType) { + case CSSUnit.CSS_NUMBER: + case CSSUnit.CSS_PERCENTAGE: + case CSSUnit.CSS_EM: + case CSSUnit.CSS_EX: + case CSSUnit.CSS_OTHER: + case CSSUnit.CSS_PX: + if (value.getCSSUnit() == unitType) { return value.getFloatValue(); } break; - case CSSPrimitiveValue.CSS_CM: + case CSSUnit.CSS_CM: return toCentimeters(value); - case CSSPrimitiveValue.CSS_MM: + case CSSUnit.CSS_MM: return toMillimeters(value); - case CSSPrimitiveValue.CSS_IN: + case CSSUnit.CSS_IN: return toInches(value); - case CSSPrimitiveValue.CSS_PT: + case CSSUnit.CSS_PT: return toPoints(value); - case CSSPrimitiveValue.CSS_PC: + case CSSUnit.CSS_PC: return toPicas(value); - case CSSPrimitiveValue.CSS_DEG: + case CSSUnit.CSS_DEG: return toDegrees(value); - case CSSPrimitiveValue.CSS_RAD: + case CSSUnit.CSS_RAD: return toRadians(value); - case CSSPrimitiveValue.CSS_GRAD: + case CSSUnit.CSS_GRAD: return toGradians(value); - case CSSPrimitiveValue.CSS_MS: + case CSSUnit.CSS_MS: return toMilliseconds(value); - case CSSPrimitiveValue.CSS_S: + case CSSUnit.CSS_S: return toSeconds(value); - case CSSPrimitiveValue.CSS_HZ: + case CSSUnit.CSS_HZ: return toHertz(value); - case CSSPrimitiveValue.CSS_KHZ: + case CSSUnit.CSS_KHZ: return tokHertz(value); } throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -218,16 +151,16 @@ public static float convertFloatValue(short unitType, Value value) { * Converts the current value into centimeters. */ protected static float toCentimeters(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_CM: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_CM: return value.getFloatValue(); - case CSSPrimitiveValue.CSS_MM: + case CSSUnit.CSS_MM: return (value.getFloatValue() / 10); - case CSSPrimitiveValue.CSS_IN: + case CSSUnit.CSS_IN: return (value.getFloatValue() * 2.54f); - case CSSPrimitiveValue.CSS_PT: + case CSSUnit.CSS_PT: return (value.getFloatValue() * 2.54f / 72); - case CSSPrimitiveValue.CSS_PC: + case CSSUnit.CSS_PC: return (value.getFloatValue() * 2.54f / 6); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -238,16 +171,16 @@ protected static float toCentimeters(Value value) { * Converts the current value into inches. */ protected static float toInches(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_CM: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_CM: return (value.getFloatValue() / 2.54f); - case CSSPrimitiveValue.CSS_MM: + case CSSUnit.CSS_MM: return (value.getFloatValue() / 25.4f); - case CSSPrimitiveValue.CSS_IN: + case CSSUnit.CSS_IN: return value.getFloatValue(); - case CSSPrimitiveValue.CSS_PT: + case CSSUnit.CSS_PT: return (value.getFloatValue() / 72); - case CSSPrimitiveValue.CSS_PC: + case CSSUnit.CSS_PC: return (value.getFloatValue() / 6); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -258,16 +191,16 @@ protected static float toInches(Value value) { * Converts the current value into millimeters. */ protected static float toMillimeters(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_CM: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_CM: return (value.getFloatValue() * 10); - case CSSPrimitiveValue.CSS_MM: + case CSSUnit.CSS_MM: return value.getFloatValue(); - case CSSPrimitiveValue.CSS_IN: + case CSSUnit.CSS_IN: return (value.getFloatValue() * 25.4f); - case CSSPrimitiveValue.CSS_PT: + case CSSUnit.CSS_PT: return (value.getFloatValue() * 25.4f / 72); - case CSSPrimitiveValue.CSS_PC: + case CSSUnit.CSS_PC: return (value.getFloatValue() * 25.4f / 6); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -278,16 +211,16 @@ protected static float toMillimeters(Value value) { * Converts the current value into points. */ protected static float toPoints(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_CM: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_CM: return (value.getFloatValue() * 72 / 2.54f); - case CSSPrimitiveValue.CSS_MM: + case CSSUnit.CSS_MM: return (value.getFloatValue() * 72 / 25.4f); - case CSSPrimitiveValue.CSS_IN: + case CSSUnit.CSS_IN: return (value.getFloatValue() * 72); - case CSSPrimitiveValue.CSS_PT: + case CSSUnit.CSS_PT: return value.getFloatValue(); - case CSSPrimitiveValue.CSS_PC: + case CSSUnit.CSS_PC: return (value.getFloatValue() * 12); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -298,16 +231,16 @@ protected static float toPoints(Value value) { * Converts the current value into picas. */ protected static float toPicas(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_CM: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_CM: return (value.getFloatValue() * 6 / 2.54f); - case CSSPrimitiveValue.CSS_MM: + case CSSUnit.CSS_MM: return (value.getFloatValue() * 6 / 25.4f); - case CSSPrimitiveValue.CSS_IN: + case CSSUnit.CSS_IN: return (value.getFloatValue() * 6); - case CSSPrimitiveValue.CSS_PT: + case CSSUnit.CSS_PT: return (value.getFloatValue() / 12); - case CSSPrimitiveValue.CSS_PC: + case CSSUnit.CSS_PC: return value.getFloatValue(); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -318,12 +251,12 @@ protected static float toPicas(Value value) { * Converts the current value into degrees. */ protected static float toDegrees(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_DEG: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_DEG: return value.getFloatValue(); - case CSSPrimitiveValue.CSS_RAD: + case CSSUnit.CSS_RAD: return (float) Math.toDegrees(value.getFloatValue()); - case CSSPrimitiveValue.CSS_GRAD: + case CSSUnit.CSS_GRAD: return (value.getFloatValue() * 9 / 5); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -334,12 +267,12 @@ protected static float toDegrees(Value value) { * Converts the current value into radians. */ protected static float toRadians(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_DEG: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_DEG: return (value.getFloatValue() * 5 / 9); // todo ?? - case CSSPrimitiveValue.CSS_RAD: + case CSSUnit.CSS_RAD: return value.getFloatValue(); - case CSSPrimitiveValue.CSS_GRAD: + case CSSUnit.CSS_GRAD: return (float) (value.getFloatValue() * 100 / Math.PI); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -350,12 +283,12 @@ protected static float toRadians(Value value) { * Converts the current value into gradians. */ protected static float toGradians(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_DEG: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_DEG: return (float) (value.getFloatValue() * Math.PI / 180); // todo ???? - case CSSPrimitiveValue.CSS_RAD: + case CSSUnit.CSS_RAD: return (float) (value.getFloatValue() * Math.PI / 100); - case CSSPrimitiveValue.CSS_GRAD: + case CSSUnit.CSS_GRAD: return value.getFloatValue(); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -366,10 +299,10 @@ protected static float toGradians(Value value) { * Converts the current value into milliseconds. */ protected static float toMilliseconds(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_MS: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_MS: return value.getFloatValue(); - case CSSPrimitiveValue.CSS_S: + case CSSUnit.CSS_S: return (value.getFloatValue() * 1000); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -380,10 +313,10 @@ protected static float toMilliseconds(Value value) { * Converts the current value into seconds. */ protected static float toSeconds(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_MS: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_MS: return (value.getFloatValue() / 1000); - case CSSPrimitiveValue.CSS_S: + case CSSUnit.CSS_S: return value.getFloatValue(); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -394,10 +327,10 @@ protected static float toSeconds(Value value) { * Converts the current value into Hertz. */ protected static float toHertz(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_HZ: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_HZ: return value.getFloatValue(); - case CSSPrimitiveValue.CSS_KHZ: + case CSSUnit.CSS_KHZ: return (value.getFloatValue() / 1000); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); @@ -408,94 +341,72 @@ protected static float toHertz(Value value) { * Converts the current value into kHertz. */ protected static float tokHertz(Value value) { - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_HZ: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_HZ: return (value.getFloatValue() * 1000); - case CSSPrimitiveValue.CSS_KHZ: + case CSSUnit.CSS_KHZ: return value.getFloatValue(); default: throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); } } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setStringValue(short,String)}. - */ @Override - public void setStringValue(short stringType, String stringValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - handler.stringValueChanged(stringType, stringValue); - } + public String getIdentifierValue() throws DOMException { + return valueProvider.getValue().getIdentifierValue(); + } + + @Override + public short getCSSUnit() { + return valueProvider.getValue().getCSSUnit(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getStringValue()}. - */ @Override public String getStringValue() throws DOMException { return valueProvider.getValue().getStringValue(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getCounterValue()}. - */ @Override - public Counter getCounterValue() throws DOMException { - return this; + public ValueModificationHandler getModificationHandler() { + return handler; } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getRectValue()}. - */ @Override - public Rect getRectValue() throws DOMException { - return this; + public String getURIValue() throws DOMException { + return valueProvider.getValue().getIdentifierValue(); + } + + @Override + public CSSCounterValue getCounterValue() throws DOMException { + return valueProvider.getValue().getCounterValue(); + } + + @Override + public RectValue getRectValue() throws DOMException { + return valueProvider.getValue().getRectValue(); } - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}. - */ @Override - public RGBColor getRGBColorValue() throws DOMException { - return this; + public ColorValue getColorValue() throws DOMException { + return valueProvider.getValue().getColorValue(); } // CSSValueList /////////////////////////////////////////////////////// - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValueList#getLength()}. - */ @Override public int getLength() { return valueProvider.getValue().getLength(); } - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValueList#item(int)}. - */ @Override - public CSSValue item(int index) { + public Value item(int index) { int len = valueProvider.getValue().getLength(); if (index < 0 || index >= len) { return null; } - if (items == null) { - items = new CSSValue[valueProvider.getValue().getLength()]; - } else if (items.length < len) { - CSSValue[] nitems = new CSSValue[len]; - System.arraycopy(items, 0, nitems, 0, items.length); - items = nitems; - } - CSSValue result = items[index]; - if (result == null) { - items[index] = result = new ListComponent(index); + Value result = valueProvider.getValue().item(index); + if (result.getModificationHandler() == null) { + result.setModificationHandler(handler); } return result; } @@ -507,123 +418,11 @@ public CSSValue item(int index) { */ @Override public String getIdentifier() { - return valueProvider.getValue().getIdentifier(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.Counter#getListStyle()}. - */ - @Override - public String getListStyle() { - return valueProvider.getValue().getListStyle(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.Counter#getSeparator()}. - */ - @Override - public String getSeparator() { - return valueProvider.getValue().getSeparator(); - } - - // Rect /////////////////////////////////////////////////////////////// - - /** - * DOM: Implements {@link org.w3c.dom.css.Rect#getTop()}. - */ - @Override - public CSSPrimitiveValue getTop() { - valueProvider.getValue().getTop(); - if (topComponent == null) { - topComponent = new TopComponent(); - } - return topComponent; - } - - /** - * DOM: Implements {@link org.w3c.dom.css.Rect#getRight()}. - */ - @Override - public CSSPrimitiveValue getRight() { - valueProvider.getValue().getRight(); - if (rightComponent == null) { - rightComponent = new RightComponent(); - } - return rightComponent; - } - - /** - * DOM: Implements {@link org.w3c.dom.css.Rect#getBottom()}. - */ - @Override - public CSSPrimitiveValue getBottom() { - valueProvider.getValue().getBottom(); - if (bottomComponent == null) { - bottomComponent = new BottomComponent(); - } - return bottomComponent; - } - - /** - * DOM: Implements {@link org.w3c.dom.css.Rect#getLeft()}. - */ - @Override - public CSSPrimitiveValue getLeft() { - valueProvider.getValue().getLeft(); - if (leftComponent == null) { - leftComponent = new LeftComponent(); - } - return leftComponent; - } - - // RGBColor /////////////////////////////////////////////////// - - /** - * DOM: Implements {@link org.w3c.dom.css.RGBColor#getRed()}. - */ - @Override - public CSSPrimitiveValue getRed() { - valueProvider.getValue().getRed(); - if (redComponent == null) { - redComponent = new RedComponent(); - } - return redComponent; - } - - /** - * DOM: Implements {@link org.w3c.dom.css.RGBColor#getGreen()}. - */ - @Override - public CSSPrimitiveValue getGreen() { - valueProvider.getValue().getGreen(); - if (greenComponent == null) { - greenComponent = new GreenComponent(); - } - return greenComponent; - } - - /** - * DOM: Implements {@link org.w3c.dom.css.RGBColor#getBlue()}. - */ - @Override - public CSSPrimitiveValue getBlue() { - valueProvider.getValue().getBlue(); - if (blueComponent == null) { - blueComponent = new BlueComponent(); - } - return blueComponent; - } - - public CSSPrimitiveValue getAlpha() { - valueProvider.getValue().getAlpha(); - if (alphaComponent == null) { - alphaComponent = new AlphaComponent(); - } - return alphaComponent; + return valueProvider.getValue().getIdentifierValue(); } /** - * To provides the actual value. + * To provide the actual value. */ public interface ValueProvider { @@ -635,888 +434,62 @@ public interface ValueProvider { } /** - * To manage the modifications on a CSS value. - */ - public interface ModificationHandler { - - /** - * Called when the value text has changed. - */ - void textChanged(String text) throws DOMException; - - /** - * Called when the float value has changed. - */ - void floatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the string value has changed. - */ - void stringValueChanged(short type, String value) throws DOMException; - - /** - * Called when the left value text has changed. - */ - void leftTextChanged(String text) throws DOMException; - - /** - * Called when the left float value has changed. - */ - void leftFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the top value text has changed. - */ - void topTextChanged(String text) throws DOMException; - - /** - * Called when the top float value has changed. - */ - void topFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the right value text has changed. - */ - void rightTextChanged(String text) throws DOMException; - - /** - * Called when the right float value has changed. - */ - void rightFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the bottom value text has changed. - */ - void bottomTextChanged(String text) throws DOMException; - - /** - * Called when the bottom float value has changed. - */ - void bottomFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the red value text has changed. - */ - void redTextChanged(String text) throws DOMException; - - /** - * Called when the red float value has changed. - */ - void redFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the green value text has changed. - */ - void greenTextChanged(String text) throws DOMException; - - /** - * Called when the green float value has changed. - */ - void greenFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the blue value text has changed. - */ - void blueTextChanged(String text) throws DOMException; - - /** - * Called when the blue float value has changed. - */ - void blueFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the alpha value text has changed. - */ - void alphaTextChanged(String text) throws DOMException; - - /** - * Called when the alpha float value has changed. - */ - void alphaFloatValueChanged(short unit, float value) throws DOMException; - - /** - * Called when the list value text has changed. - */ - void listTextChanged(int idx, String text) throws DOMException; - - /** - * Called when the list float value has changed. - */ - void listFloatValueChanged(int idx, short unit, float value) throws DOMException; - - /** - * Called when the list string value has changed. - */ - void listStringValueChanged(int idx, short unit, String value) throws DOMException; - - } - - /** - * This class provides an abstract implementation of a ModificationHandler. + * To store a component. */ - public abstract static class AbstractModificationHandler implements ModificationHandler { + protected abstract class AbstractComponent implements Value { /** - * Returns the associated value. + * The returns the actual value of this component. */ protected abstract Value getValue(); - /** - * Called when the float value has changed. - */ - @Override - public void floatValueChanged(short unit, float value) throws DOMException { - textChanged(FloatValue.getCssText(unit, value)); - } - - /** - * Called when the string value has changed. - */ - @Override - public void stringValueChanged(short type, String value) throws DOMException { - textChanged(StringValue.getCssText(type, value)); - } - - /** - * Called when the left value text has changed. - */ - @Override - public void leftTextChanged(String text) throws DOMException { - final Value val = getValue(); - text = "rect(" + val.getTop().getCssText() + ", " + val.getRight().getCssText() + ", " - + val.getBottom().getCssText() + ", " + text + ')'; - textChanged(text); - } - - /** - * Called when the left float value has changed. - */ - @Override - public void leftFloatValueChanged(short unit, float value) throws DOMException { - final Value val = getValue(); - String text = "rect(" + val.getTop().getCssText() + ", " + val.getRight().getCssText() + ", " - + val.getBottom().getCssText() + ", " + FloatValue.getCssText(unit, value) + ')'; - textChanged(text); - } - - /** - * Called when the top value text has changed. - */ - @Override - public void topTextChanged(String text) throws DOMException { - final Value val = getValue(); - text = "rect(" + text + ", " + val.getRight().getCssText() + ", " + val.getBottom().getCssText() + ", " - + val.getLeft().getCssText() + ')'; - textChanged(text); - } - - /** - * Called when the top float value has changed. - */ - @Override - public void topFloatValueChanged(short unit, float value) throws DOMException { - final Value val = getValue(); - String text = "rect(" + FloatValue.getCssText(unit, value) + ", " + val.getRight().getCssText() + ", " - + val.getBottom().getCssText() + ", " + val.getLeft().getCssText() + ')'; - textChanged(text); - } - - /** - * Called when the right value text has changed. - */ - @Override - public void rightTextChanged(String text) throws DOMException { - final Value val = getValue(); - text = "rect(" + val.getTop().getCssText() + ", " + text + ", " + val.getBottom().getCssText() + ", " - + val.getLeft().getCssText() + ')'; - textChanged(text); - } - - /** - * Called when the right float value has changed. - */ @Override - public void rightFloatValueChanged(short unit, float value) throws DOMException { - final Value val = getValue(); - String text = "rect(" + val.getTop().getCssText() + ", " + FloatValue.getCssText(unit, value) + ", " - + val.getBottom().getCssText() + ", " + val.getLeft().getCssText() + ')'; - textChanged(text); + public String getCssText() { + return valueProvider.getValue().getCssText(); } - /** - * Called when the bottom value text has changed. - */ @Override - public void bottomTextChanged(String text) throws DOMException { - final Value val = getValue(); - text = "rect(" + val.getTop().getCssText() + ", " + val.getRight().getCssText() + ", " + text + ", " - + val.getLeft().getCssText() + ')'; - textChanged(text); + public CssType getCssValueType() { + return valueProvider.getValue().getCssValueType(); } - /** - * Called when the bottom float value has changed. - */ @Override - public void bottomFloatValueChanged(short unit, float value) throws DOMException { - final Value val = getValue(); - String text = "rect(" + val.getTop().getCssText() + ", " + val.getRight().getCssText() + ", " - + FloatValue.getCssText(unit, value) + ", " + val.getLeft().getCssText() + ')'; - textChanged(text); + public Type getPrimitiveType() { + return valueProvider.getValue().getPrimitiveType(); } - /** - * Called when the red value text has changed. - */ @Override - public void redTextChanged(String text) throws DOMException { - final Value val = getValue(); - text = RGBColorValue.toString(text, val.getGreen().getCssText(), val.getBlue().getCssText(), - val.getAlpha().getCssText()); - textChanged(text); + public float getFloatValue() throws DOMException { + return valueProvider.getValue().getFloatValue(); } - /** - * Called when the red float value has changed. - */ @Override - public void redFloatValueChanged(short unit, float value) throws DOMException { - redTextChanged(FloatValue.getCssText(unit, value)); + public String getStringValue() throws DOMException { + return valueProvider.getValue().getStringValue(); } - /** - * Called when the green value text has changed. - */ @Override - public void greenTextChanged(String text) throws DOMException { - final Value val = getValue(); - text = RGBColorValue.toString(val.getRed().getCssText(), text, val.getBlue().getCssText(), - val.getAlpha().getCssText()); - textChanged(text); + public CSSCounterValue getCounterValue() throws DOMException { + throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); } - /** - * Called when the green float value has changed. - */ @Override - public void greenFloatValueChanged(short unit, float value) throws DOMException { - greenTextChanged(FloatValue.getCssText(unit, value)); + public RectValue getRectValue() throws DOMException { + throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); } - /** - * Called when the blue value text has changed. - */ @Override - public void blueTextChanged(String text) throws DOMException { - final Value val = getValue(); - text = RGBColorValue.toString(val.getRed().getCssText(), val.getGreen().getCssText(), text, - val.getAlpha().getCssText()); - textChanged(text); + public ColorValue getColorValue() throws DOMException { + throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); } - /** - * Called when the blue float value has changed. - */ - @Override - public void blueFloatValueChanged(short unit, float value) throws DOMException { - blueTextChanged(FloatValue.getCssText(unit, value)); - } + // CSSStyleValueList /////////////////////////////////////////////////// @Override - public void alphaTextChanged(String text) throws DOMException { - final Value val = getValue(); - text = RGBColorValue.toString(val.getRed().getCssText(), val.getGreen().getCssText(), - val.getBlue().getCssText(), text); - textChanged(text); - } - - @Override - public void alphaFloatValueChanged(short unit, float value) throws DOMException { - alphaTextChanged(FloatValue.getCssText(unit, value)); - } - - /** - * Called when the list value text has changed. - */ - @Override - public void listTextChanged(int idx, String text) throws DOMException { - ListValue lv = (ListValue) getValue(); - int len = lv.getLength(); - StringBuilder sb = new StringBuilder(len * 8); - for (int i = 0; i < idx; i++) { - sb.append(lv.item(i).getCssText()); - sb.append(lv.getSeparatorChar()); - } - sb.append(text); - for (int i = idx + 1; i < len; i++) { - sb.append(lv.getSeparatorChar()); - sb.append(lv.item(i).getCssText()); - } - text = sb.toString(); - textChanged(text); - } - - /** - * Called when the list float value has changed. - */ - @Override - public void listFloatValueChanged(int idx, short unit, float value) throws DOMException { - ListValue lv = (ListValue) getValue(); - int len = lv.getLength(); - StringBuilder sb = new StringBuilder(len * 8); - for (int i = 0; i < idx; i++) { - sb.append(lv.item(i).getCssText()); - sb.append(lv.getSeparatorChar()); - } - sb.append(FloatValue.getCssText(unit, value)); - for (int i = idx + 1; i < len; i++) { - sb.append(lv.getSeparatorChar()); - sb.append(lv.item(i).getCssText()); - } - textChanged(sb.toString()); - } - - /** - * Called when the list string value has changed. - */ - @Override - public void listStringValueChanged(int idx, short unit, String value) throws DOMException { - ListValue lv = (ListValue) getValue(); - int len = lv.getLength(); - StringBuilder sb = new StringBuilder(len * 8); - for (int i = 0; i < idx; i++) { - sb.append(lv.item(i).getCssText()); - sb.append(lv.getSeparatorChar()); - } - sb.append(StringValue.getCssText(unit, value)); - for (int i = idx + 1; i < len; i++) { - sb.append(lv.getSeparatorChar()); - sb.append(lv.item(i).getCssText()); - } - textChanged(sb.toString()); - } - - } - - /** - * To store a component. - */ - protected abstract class AbstractComponent implements CSSPrimitiveValue { - - /** - * The returns the actual value of this component. - */ - protected abstract Value getValue(); - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#getCssText()}. - */ - @Override - public String getCssText() { - return getValue().getCssText(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#getCssValueType()}. - */ - @Override - public short getCssValueType() { - return getValue().getCssValueType(); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getPrimitiveType()}. - */ - @Override - public short getPrimitiveType() { - return getValue().getPrimitiveType(); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getFloatValue(short)}. - */ - @Override - public float getFloatValue(short unitType) throws DOMException { - return convertFloatValue(unitType, getValue()); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getStringValue()}. - */ - @Override - public String getStringValue() throws DOMException { - return valueProvider.getValue().getStringValue(); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getCounterValue()}. - */ - @Override - public Counter getCounterValue() throws DOMException { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getRectValue()}. - */ - @Override - public Rect getRectValue() throws DOMException { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}. - */ - @Override - public RGBColor getRGBColorValue() throws DOMException { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - // CSSValueList /////////////////////////////////////////////////////// - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValueList#getLength()}. - */ public int getLength() { throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); } - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValueList#item(int)}. - */ - public CSSValue item(int index) { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - } - - /** - * To store a Float component. - */ - protected abstract class FloatComponent extends AbstractComponent { - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setStringValue(short,String)}. - */ - @Override - public void setStringValue(short stringType, String stringValue) throws DOMException { - throw new DOMException(DOMException.INVALID_ACCESS_ERR, ""); - } - - } - - /** - * To represents a left component. - */ - protected class LeftComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getLeft(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.leftTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.leftFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a top component. - */ - protected class TopComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getTop(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.topTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.topFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a right component. - */ - protected class RightComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getRight(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.rightTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.rightFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a bottom component. - */ - protected class BottomComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getBottom(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.bottomTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.bottomFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a red component. - */ - protected class RedComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getRed(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.redTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.redFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a green component. - */ - protected class GreenComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getGreen(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.greenTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.greenFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a blue component. - */ - protected class BlueComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getBlue(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.blueTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.blueFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents an alpha component. - */ - protected class AlphaComponent extends FloatComponent { - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - return valueProvider.getValue().getAlpha(); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.alphaTextChanged(cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.alphaFloatValueChanged(unitType, floatValue); - } - } - - } - - /** - * To represents a List component. - */ - protected class ListComponent extends AbstractComponent { - - /** - * The index of this component. - */ - protected int index; - - /** - * Creates a new ListComponent. - */ - public ListComponent(int idx) { - index = idx; - } - - /** - * The returns the actual value of this component. - */ - @Override - protected Value getValue() { - if (index >= valueProvider.getValue().getLength()) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } - return valueProvider.getValue().item(index); - } - - /** - * DOM: Implements {@link org.w3c.dom.css.CSSValue#setCssText(String)}. - */ - @Override - public void setCssText(String cssText) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.listTextChanged(index, cssText); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setFloatValue(short,float)}. - */ - @Override - public void setFloatValue(short unitType, float floatValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.listFloatValueChanged(index, unitType, floatValue); - } - } - - /** - * DOM: Implements - * {@link org.w3c.dom.css.CSSPrimitiveValue#setStringValue(short,String)}. - */ - @Override - public void setStringValue(short stringType, String stringValue) throws DOMException { - if (handler == null) { - throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); - } else { - getValue(); - handler.listStringValueChanged(index, stringType, stringValue); - } - } - } } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMViewCSS.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMViewCSS.java index a7a397134..aa8a050ab 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMViewCSS.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSOMViewCSS.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.dom; +import org.w3c.css.om.CSSStyleDeclaration; import org.w3c.dom.Element; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.ViewCSS; +import org.w3c.dom.view.ViewCSS; import org.w3c.dom.views.DocumentView; import io.sf.carte.echosvg.css.engine.CSSEngine; diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSValue.java new file mode 100644 index 000000000..fd021a246 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/dom/CSSValue.java @@ -0,0 +1,358 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.dom; + +import org.w3c.css.om.typed.CSSKeywordValue; +import org.w3c.css.om.typed.CSSStringValue; +import org.w3c.css.om.typed.CSSStyleValue; +import org.w3c.dom.DOMException; + +import org.w3c.css.om.unit.CSSUnit; +import io.sf.carte.doc.style.css.property.KeywordValue; +import io.sf.carte.echosvg.css.engine.value.ListValue; +import io.sf.carte.echosvg.css.engine.value.NumericValue; +import io.sf.carte.echosvg.css.engine.value.StringValue; + +/** + * A gateway value, useful in the transition to Typed OM. + * + * @author See Git history. + * @version $Id$ + */ +public interface CSSValue extends CSSStyleValue { + + /** + * The main categories of values. + */ + enum CssType { + + /** + * A CSS-wide keyword like {@code inherit}. + */ + KEYWORD, + + /** + *

+ * A vehicle towards a final value, of a CSS type that cannot be anticipated. + *

+ *

+ * Example: {@code var()} or {@code attr()}. + *

+ *

+ * (note that {@code attr()} has two components, a main one whose type + * could be anticipated, and a fallback that could be of a different type). + *

+ */ + PROXY, + + /** + * A typed primitive value, includes numbers and identifiers. + */ + TYPED, + + /** + * A list of values. + *

+ * You can cast to {@link ListValue}. + *

+ */ + LIST, + + /** + * A shorthand property. + */ + SHORTHAND + } + + /** + * The type of value. For keywords, it is the keyword. + */ + enum Type { + /** + * Unknown type, probably a system default or a compat value. + */ + UNKNOWN, + + /** + * {@code inherit} keyword. + */ + INHERIT, + + /** + * {@code initial} keyword. + */ + INITIAL, + + /** + * {@code unset} keyword. + */ + UNSET, + + /** + * {@code revert} keyword. + */ + REVERT, + + /** + * Numeric type (excludes {@code calc()} which is an {@link #EXPRESSION}). + *

+ * Cast to {@link NumericValue}. + *

+ */ + NUMERIC, + + /** + * String. + *

+ * Cast to {@link StringValue}. + *

+ */ + STRING, + + /** + * Identifier. + *

+ * Cast to {@link KeywordValue}. + *

+ */ + IDENT, + + /** + * Color. + */ + COLOR, + + /** + * Color-Mix function. + */ + COLOR_MIX, + + /** + * URI ({@code url()}). + *

+ * Cast to {@link CSSStringValue}. + *

+ */ + URI, + + /** + * {@code rect()} function. + */ + RECT, + + /** + * An expression with algebraic syntax (i.e. calc()). + */ + EXPRESSION, + + /** + * Gradient function. + */ + GRADIENT, + + /** + * CSS counter() function. + */ + COUNTER, + + /** + * CSS counters() function. + */ + COUNTERS, + + /** + * cubic-bezier() easing function. + */ + CUBIC_BEZIER, + + /** + * steps() easing function. + */ + STEPS, + + /** + * Function. + */ + FUNCTION, + + /** + * Mathematical function (as defined by CSS Values and Units). + */ + MATH_FUNCTION, + + /** + * Unicode range. + */ + UNICODE_RANGE, + + /** + * Unicode character. + */ + UNICODE_CHARACTER, + + /** + * Unicode wildcard. + */ + UNICODE_WILDCARD, + + /** + * Element reference. + *

+ * Cast to {@link CSSKeywordValue}. + *

+ */ + ELEMENT_REFERENCE, + + /** + * Ratio value. + */ + RATIO, + + /** + * {@code attr()} function. + */ + ATTR, + + /** + * Custom property reference. + */ + VAR, + + /** + * Environment variable. + */ + ENV, + + /** + * Lexical value. + */ + LEXICAL, + + /** + * For this library's internal use. + */ + INTERNAL, + + /** + * Invalid (non-primitive and non-keyword) value. + *

+ * The value is either a list or a shorthand. + *

+ */ + INVALID + + } + + /** + * Get the general category to which this value belongs. + * + * @return the general value type. + */ + CssType getCssValueType(); + + /** + * Get the primitive type. + * + * @return the primitive type. + */ + Type getPrimitiveType(); + + /** + * Gets the css unit as in CSS4J's {@code CSSUnit}. + *

+ * If the value has no valid CSS unit, returns {@code CSSUnit.CSS_INVALID}. + *

+ * + * @return the css unit as in CSS4J's {@code CSSUnit}. + */ + default short getCSSUnit() { + return CSSUnit.CSS_INVALID; + } + + /** + * Set this value to the result of parsing the argument. + * + * @param cssText a CSS serialization to set this value. + * @throws DOMException + */ + void setCssText(String cssText) throws DOMException; + + /** + * Get a parsable representation of this value. + * + * @return the CSS serialization of this value. + */ + String getCssText(); + + /** + * Convenience method that either returns the float value, if the value is + * numeric, or throws an exception. + * + * @return the float value. + */ + float getFloatValue(); + + /** + * Convenience method that either returns an identifier or throws an exception. + * + * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't + * contain an identifier value. + */ + String getIdentifierValue() throws DOMException; + + /** + * If this value can be used where a string is expected, get the value. + * + * @return the string value, without the commas. + * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't + * contain a String. + */ + String getStringValue() throws DOMException; + + /** + * Convenience method that either returns a String or URI or throws an exception. + * + * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't + * contain a String nor a URI value. + */ + String getURIValue() throws DOMException; + + /** + * If this value is a list or contains components, the number of + * CSSStyleValues in the list. The range of valid values of the + * indices is 0 to length-1 inclusive. + * + * @return the number of components, or {@code 0} if this value is not a list + * nor does it contain components. + */ + int getLength(); + + /** + * If this value is a list, give the item corresponding to the requested index. + * If there is no item at such index, return {@code null} If this object is not + * a list and the index is {@code 0}, return itself. + * + * @param index the index on the list. + * @return the item, or {@code null} if there is no item on that index. + */ + default CSSValue item(int index) { + return index == 0 ? this : null; + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/CSSContext.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/CSSContext.java index c3fbb843e..e423b7561 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/CSSContext.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/CSSContext.java @@ -20,6 +20,7 @@ import org.w3c.dom.Element; +import io.sf.carte.echosvg.css.Viewport; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.util.ParsedURL; @@ -27,8 +28,10 @@ * This interface allows the user of a CSSEngine to provide contextual * informations. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public interface CSSContext { @@ -84,6 +87,13 @@ default float getPixelToMillimeter() { */ float getBlockHeight(Element elt); + /** + * Returns the viewport of the specified element. + * + * @param e the element interested in its viewport + */ + Viewport getViewport(Element e); + /** * This method should throw a SecurityException if the resource found at url and * referenced from docURL should not be loaded. diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/SystemColorSupport.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/SystemColorSupport.java index 1e2651143..bce6adf6e 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/SystemColorSupport.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/SystemColorSupport.java @@ -23,7 +23,7 @@ import java.util.HashMap; import java.util.Map; -import org.w3c.dom.css.CSSPrimitiveValue; +import org.w3c.css.om.unit.CSSUnit; import io.sf.carte.echosvg.css.engine.value.FloatValue; import io.sf.carte.echosvg.css.engine.value.RGBColorValue; @@ -33,8 +33,10 @@ /** * This class provides support for AWT system colors. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class SystemColorSupport implements CSSConstants { @@ -45,9 +47,9 @@ public class SystemColorSupport implements CSSConstants { public static Value getSystemColor(String ident) { ident = ident.toLowerCase(); // todo locale?? SystemColor sc = factories.get(ident); - return new RGBColorValue(new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getRed()), - new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getGreen()), - new FloatValue(CSSPrimitiveValue.CSS_NUMBER, sc.getBlue())); + return new RGBColorValue(new FloatValue(CSSUnit.CSS_NUMBER, sc.getRed()), + new FloatValue(CSSUnit.CSS_NUMBER, sc.getGreen()), + new FloatValue(CSSUnit.CSS_NUMBER, sc.getBlue())); } /** diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractColorManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractColorManager.java index 3d4d755d7..cd5423e61 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractColorManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractColorManager.java @@ -21,8 +21,8 @@ import java.io.IOException; import java.io.StringReader; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.CSSTypedValue; import io.sf.carte.doc.style.css.CSSValue.CssType; @@ -32,17 +32,21 @@ import io.sf.carte.doc.style.css.parser.CSSParser; import io.sf.carte.doc.style.css.property.StyleValue; import io.sf.carte.doc.style.css.property.ValueFactory; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; +import io.sf.carte.echosvg.css.engine.value.svg.SVGValueConstants; import io.sf.carte.echosvg.util.CSSConstants; /** * This class provides a manager for the property with support for CSS color * values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public abstract class AbstractColorManager extends IdentifierManager { @@ -130,13 +134,17 @@ public abstract class AbstractColorManager extends IdentifierManager { @Override public Value createValue(LexicalUnit lunit, CSSEngine engine) throws DOMException { switch (lunit.getLexicalUnitType()) { + case COLOR_FUNCTION: + Value colorFunction = createColorFunction(lunit); + if (colorFunction != null) { + return colorFunction; + } case HSLCOLOR: case HWBCOLOR: case LABCOLOR: case LCHCOLOR: case OKLABCOLOR: case OKLCHCOLOR: - case COLOR_FUNCTION: case COLOR_MIX: ValueFactory vf = new ValueFactory(); String rgbSerialization; @@ -157,34 +165,7 @@ public Value createValue(LexicalUnit lunit, CSSEngine engine) throws DOMExceptio throw createInvalidLexicalUnitDOMException(lunit.getLexicalUnitType()); } case RGBCOLOR: - LexicalUnit lu = lunit.getParameters(); - Value red = createColorComponent(lu); - lu = lu.getNextLexicalUnit(); - if (lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_COMMA) { - lu = lu.getNextLexicalUnit(); - } - Value green = createColorComponent(lu); - lu = lu.getNextLexicalUnit(); - if (lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_COMMA) { - lu = lu.getNextLexicalUnit(); - } - Value blue = createColorComponent(lu); - // Alpha channel - lu = lu.getNextLexicalUnit(); - Value alpha; - if (lu != null) { - if (lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_COMMA - || lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_SLASH) { - lu = lu.getNextLexicalUnit(); - if (lu == null) { - throw new DOMException(DOMException.SYNTAX_ERR, "Invalid color: " + lunit.getCssText()); - } - } - alpha = createColorComponent(lu); - } else { - alpha = null; - } - return createRGBColor(red, green, blue, alpha); + return createRGBColor(lunit); default: return super.createValue(lunit, engine); } @@ -197,8 +178,8 @@ public Value createValue(LexicalUnit lunit, CSSEngine engine) throws DOMExceptio @Override public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { - if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) { - String ident = value.getStringValue(); + if (value.getPrimitiveType() == Type.IDENT) { + String ident = ((AbstractStringValue) value).getValue(); // Search for a direct computed value. Value v = (Value) computedValues.get(ident); if (v != null) { @@ -213,26 +194,138 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin return super.computeValue(elt, pseudo, engine, idx, sm, value); } + private Value createRGBColor(LexicalUnit lunit) { + LexicalUnit lu = lunit.getParameters(); + + boolean pcntSpecified = lu.getLexicalUnitType() == LexicalType.PERCENTAGE; + NumericValue red = createRGBColorComponent(lu); + lu = lu.getNextLexicalUnit(); + if (lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_COMMA) { + lu = lu.getNextLexicalUnit(); + } + + pcntSpecified = pcntSpecified || lu.getLexicalUnitType() == LexicalType.PERCENTAGE; + NumericValue green = createRGBColorComponent(lu); + lu = lu.getNextLexicalUnit(); + if (lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_COMMA) { + lu = lu.getNextLexicalUnit(); + } + + pcntSpecified = pcntSpecified || lu.getLexicalUnitType() == LexicalType.PERCENTAGE; + NumericValue blue = createRGBColorComponent(lu); + + // Alpha channel + lu = lu.getNextLexicalUnit(); + NumericValue alpha; + boolean alphaPcntSpecified = false; + if (lu != null) { + if (lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_COMMA + || lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_SLASH) { + lu = lu.getNextLexicalUnit(); + if (lu == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Invalid color: " + lunit.getCssText()); + } + } + alphaPcntSpecified = lu.getLexicalUnitType() == LexicalType.PERCENTAGE; + alpha = createColorComponent(lu); + } else { + alpha = null; + } + return createRGBColor(red, green, blue, pcntSpecified, alpha, alphaPcntSpecified); + } + /** * Creates an RGB(A) color. */ - protected Value createRGBColor(Value r, Value g, Value b, Value a) { - return a == null ? new RGBColorValue(r, g, b) : new RGBColorValue(r, g, b, a); + protected Value createRGBColor(NumericValue r, NumericValue g, NumericValue b, boolean pcntSpecified, + NumericValue a, boolean alphaPcntSpecified) { + RGBColorValue c = a == null ? new RGBColorValue(r, g, b) : new RGBColorValue(r, g, b, a); + c.setSpecifiedAsPercentage(pcntSpecified); + c.setAlphaSpecifiedAsPercentage(alphaPcntSpecified); + return c; + } + + private ColorFunction createColorFunction(LexicalUnit lunit) { + LexicalUnit lu = lunit.getParameters(); + AbstractValueList components = new AbstractValueList<>(' ', 4); + + // Color space + if (lu.getLexicalUnitType() != LexicalUnit.LexicalType.IDENT) { + throw new DOMException(DOMException.TYPE_MISMATCH_ERR, + "Color space must be identifier: " + lunit.toString()); + } + + String colorSpace = lu.getStringValue(); + lu = lu.getNextLexicalUnit(); + if (lu == null) { + throw new DOMException(DOMException.SYNTAX_ERR, "Wrong value: " + lunit.toString()); + } + + // Components + NumericValue alpha = null; + NumericValue primi; + while (true) { + primi = createColorComponent(lu); + components.add(primi); + lu = lu.getNextLexicalUnit(); + + if (lu == null) { + break; + } + if (lu.getLexicalUnitType() == LexicalUnit.LexicalType.OPERATOR_SLASH) { + lu = lu.getNextLexicalUnit(); // Alpha + alpha = createColorComponent(lu); + lu = lu.getNextLexicalUnit(); + if (lu != null) { + throw new DOMException(DOMException.SYNTAX_ERR, + "Wrong value: " + lunit.toString()); + } + break; + } + } + + ColorFunction color = new ColorFunction(colorSpace, components); + + if (alpha == null) { + alpha = SVGValueConstants.NUMBER_1; + } + color.setAlpha(alpha); + + return color; + } + + /** + * Creates an RGB color component from a lexical unit. + */ + protected NumericValue createRGBColorComponent(LexicalUnit lu) throws DOMException { + switch (lu.getLexicalUnitType()) { + case INTEGER: + return new FloatValue(CSSUnit.CSS_PERCENTAGE, lu.getIntegerValue() / 2.55f); + + case REAL: + return new FloatValue(CSSUnit.CSS_PERCENTAGE, lu.getFloatValue() / 2.55f); + + case PERCENTAGE: + return new FloatValue(CSSUnit.CSS_PERCENTAGE, lu.getFloatValue()); + + default: + } + throw createInvalidRGBComponentUnitDOMException(lu.getLexicalUnitType()); } /** * Creates a color component from a lexical unit. */ - protected Value createColorComponent(LexicalUnit lu) throws DOMException { + protected NumericValue createColorComponent(LexicalUnit lu) throws DOMException { switch (lu.getLexicalUnitType()) { case INTEGER: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getIntegerValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getIntegerValue()); case REAL: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getFloatValue()); case PERCENTAGE: - return new FloatValue(CSSPrimitiveValue.CSS_PERCENTAGE, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_PERCENTAGE, lu.getFloatValue()); default: } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractCounterValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractCounterValue.java new file mode 100644 index 000000000..3d8b10286 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractCounterValue.java @@ -0,0 +1,141 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import java.util.Objects; + +import org.w3c.css.om.typed.CSSCounterValue; +import org.w3c.dom.DOMException; + +/** + * Abstract class for counter() and counters() functions. + * + */ +abstract class AbstractCounterValue extends ComponentValue implements CSSCounterValue { + + private String identifier; + private Value listStyle = null; + + protected AbstractCounterValue() { + super(); + } + + AbstractCounterValue(String identifier, Value listStyle) { + super(); + this.identifier = identifier; + this.listStyle = listStyle; + } + + @Override + public String getName() { + return identifier; + } + + public void setName(String identifier) { + this.identifier = identifier; + if (handler != null) { + handler.valueChanged(this); + } + } + + @Override + public Value getCounterStyle() { + return listStyle; + } + + void setCounterStyle(AbstractValue listStyle) { + componentize(listStyle); + this.listStyle = listStyle; + if (handler != null) { + handler.valueChanged(this); + } + } + + @Override + public String getSeparator() { + return ""; + } + + @Override + public Value item(int index) { + if (index == 0) { + return getCounterStyle(); + } + return null; + } + + void set(int index, Value component) throws DOMException { + if (index == 0) { + setCounterStyle((AbstractValue) component); + } + } + + @Override + public int getLength() { + return 1; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((identifier == null) ? 0 : identifier.hashCode()); + result = prime * result + ((listStyle == null) ? decimalHashCode() : listStyle.hashCode()); + return result; + } + + private int decimalHashCode() { + int result = 31 * CssType.TYPED.hashCode() + Type.IDENT.hashCode(); + result = 31 * result + "decimal".hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + + AbstractCounterValue other = (AbstractCounterValue) obj; + if (identifier == null) { + if (other.identifier != null) { + return false; + } + } else if (!identifier.equals(other.identifier)) { + return false; + } + + return Objects.equals(listStyle, other.listStyle); + } + + static void quoteSeparator(String separator, StringBuilder buf) { + if (!separator.contains("'")) { + buf.append('\'').append(separator).append('\''); + } else { + buf.append('"').append(separator).append('"'); + } + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractStringValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractStringValue.java new file mode 100644 index 000000000..6dcdf2bb9 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractStringValue.java @@ -0,0 +1,86 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import java.util.Objects; + +import org.w3c.api.DOMTypeException; + +/** + * Abstract class for string values. + * + * @version $Id$ + */ +public abstract class AbstractStringValue extends AbstractValue { + + /** + * The value of the string + */ + String value; + + /** + * Creates a new StringValue. + */ + public AbstractStringValue(String s) { + value = s; + } + + @Override + public int hashCode() { + return Objects.hash(getPrimitiveType(), value); + } + + /** + * Indicates whether some other object is "equal to" this one. + * + * @param obj the reference object with which to compare. + */ + @Override + public boolean equals(Object obj) { + if (obj == null || !(obj instanceof AbstractStringValue) + || getPrimitiveType() != ((AbstractStringValue) obj).getPrimitiveType()) { + return false; + } + AbstractStringValue v = (AbstractStringValue) obj; + return value.equals(v.value); + } + + /** + * This method is used to get the string value. + * + */ + public String getValue() { + return value; + } + + public void setValue(String value) throws DOMTypeException { + if (value == null || value.isEmpty()) { + throw new DOMTypeException("Value is null or empty."); + } + this.value = value; + + if (handler != null) { + handler.valueChanged(this); + } + } + + @Override + public abstract AbstractStringValue clone(); + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValue.java index 2323ae514..b5d4121ea 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValue.java @@ -18,161 +18,138 @@ */ package io.sf.carte.echosvg.css.engine.value; +import org.w3c.css.om.typed.CSSCounterValue; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSValue; /** * This class provides an abstract implementation of the Value interface. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + *

* @version $Id$ */ -public abstract class AbstractValue implements Value { +public abstract class AbstractValue implements Value, Cloneable { - /** - * Implements {@link Value#getCssValueType()}. - */ - @Override - public short getCssValueType() { - return CSSValue.CSS_PRIMITIVE_VALUE; - } + ValueModificationHandler handler; - /** - * Implements {@link Value#getPrimitiveType()}. - */ @Override - public short getPrimitiveType() { - throw createDOMException(); + public CssType getCssValueType() { + return Value.CssType.TYPED; } - /** - * Implements {@link Value#getFloatValue()}. - */ @Override - public float getFloatValue() throws DOMException { + public Type getPrimitiveType() { throw createDOMException(); } - /** - * Implements {@link Value#getStringValue()}. - */ @Override - public String getStringValue() throws DOMException { - throw createDOMException(); + public short getCSSUnit() { + return CSSUnit.CSS_INVALID; } - /** - * Implements {@link Value#getRed()}. - */ @Override - public Value getRed() throws DOMException { + public void setCssText(String cssText) throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#getGreen()}. - */ @Override - public Value getGreen() throws DOMException { - throw createDOMException(); + public String toString() { + return getCssText(); } /** - * Implements {@link Value#getBlue()}. + * Implements {@link Value#getFloatValue()}. */ @Override - public Value getBlue() throws DOMException { + public float getFloatValue() throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#getAlpha()}. - */ @Override - public Value getAlpha() throws DOMException { + public void setFloatValue(float value) throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#getLength()}. - */ @Override - public int getLength() throws DOMException { + public String getStringValue() throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#item(int)}. - */ @Override - public Value item(int index) throws DOMException { - throw createDOMException(); + public int getLength() throws DOMException { + return 0; } - /** - * Implements {@link Value#getTop()}. - */ @Override - public Value getTop() throws DOMException { + public String getIdentifierValue() throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#getRight()}. - */ @Override - public Value getRight() throws DOMException { + public String getURIValue() throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#getBottom()}. - */ @Override - public Value getBottom() throws DOMException { + public CSSCounterValue getCounterValue() throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#getLeft()}. - */ @Override - public Value getLeft() throws DOMException { + public RectValue getRectValue() throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#getIdentifier()}. - */ @Override - public String getIdentifier() throws DOMException { + public ColorValue getColorValue() throws DOMException { throw createDOMException(); } - /** - * Implements {@link Value#getListStyle()}. - */ @Override - public String getListStyle() throws DOMException { - throw createDOMException(); + public void setModificationHandler(ValueModificationHandler handler) { + this.handler = handler; } - /** - * Implements {@link Value#getSeparator()}. - */ @Override - public String getSeparator() throws DOMException { - throw createDOMException(); + public ValueModificationHandler getModificationHandler() { + return handler; } /** * Creates an INVALID_ACCESS_ERR exception. */ protected DOMException createDOMException() { - Object[] p = { (int) getCssValueType() }; + Object[] p = { getPrimitiveType() }; String s = Messages.formatMessage("invalid.value.access", p); return new DOMException(DOMException.INVALID_ACCESS_ERR, s); } + @Override + public int hashCode() { + return getPrimitiveType().hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof Value)) + return false; + Value other = (Value) obj; + return getPrimitiveType() == other.getPrimitiveType(); + } + + @Override + public AbstractValue clone() { + try { + return (AbstractValue) super.clone(); + } catch (CloneNotSupportedException e) { + return null; + } + } + } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueFactory.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueFactory.java index 5758187be..70d1e007e 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueFactory.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueFactory.java @@ -21,13 +21,16 @@ import org.w3c.dom.DOMException; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.util.ParsedURL; /** * This class provides a base implementation for the value factories. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public abstract class AbstractValueFactory { @@ -83,8 +86,8 @@ protected DOMException createInvalidFloatValueDOMException(float f) { /** * Creates a DOM exception, given an invalid string type. */ - protected DOMException createInvalidStringTypeDOMException(short t) { - Object[] p = { getPropertyName(), (int) t }; + protected DOMException createInvalidStringTypeDOMException(Type t) { + Object[] p = { getPropertyName(), t }; String s = Messages.formatMessage("invalid.string.type", p); return new DOMException(DOMException.INVALID_ACCESS_ERR, s); } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueList.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueList.java new file mode 100644 index 000000000..dccf0fe17 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueList.java @@ -0,0 +1,151 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import java.util.ArrayList; +import java.util.Iterator; + +import org.w3c.css.om.typed.CSSStyleValueList; + +/** + * This class represents a list of values. + * + * @author See Git history. + * @version $Id$ + */ +public class AbstractValueList extends ComponentValue implements CSSStyleValueList { + + /** + * The items. + */ + private ArrayList items; + + /** + * The list separator. + */ + private char separator; + + /** + * Creates a ListValue. + */ + public AbstractValueList() { + this(','); + } + + /** + * Creates a ListValue with the given separator. + */ + public AbstractValueList(char s) { + this(s, 5); + } + + /** + * Creates a ListValue with the given separator and an initial capacity. + */ + public AbstractValueList(char s, int initialCapacity) { + separator = s; + items = new ArrayList<>(initialCapacity); + } + + @Override + public AbstractValueList clone() { + AbstractValueList clon = new AbstractValueList<>(separator, items.size()); + clon.items.addAll(items); + return clon; + } + + /** + * Returns the separator used for this list. + */ + public char getSeparatorChar() { + return separator; + } + + @Override + public CssType getCssValueType() { + return CssType.LIST; + } + + @Override + public Type getPrimitiveType() { + return Type.INVALID; // Not a primitive + } + + /** + * Appends an item to the list. + */ + public boolean add(V value) { + boolean b = items.add(value); + componentAdded(value); + return b; + } + + /** + * A string representation of the current value. + */ + @Override + public String getCssText() { + int length = items.size(); + StringBuilder sb = new StringBuilder(length * 8); + if (length > 0) { + sb.append(items.get(0).toString()); + } + for (int i = 1; i < length; i++) { + sb.append(separator); + sb.append(items.get(i).toString()); + } + return sb.toString(); + } + + @Override + public V item(int index) { + return items.get(index); + } + + @Override + public int getLength() { + return items.size(); + } + + @Override + public Iterator iterator() { + return items.iterator(); + } + + public void clear() { + items.clear(); + } + + public boolean isEmpty() { + return items.isEmpty(); + } + + public V remove(int index) { + V item = items.remove(index); + componentRemoved(item); + return item; + } + + public V set(int index, V value) { + V v = items.set(index, value); + getComponentHandler().listValueChanged(index, value); + return v; + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueManager.java index a704fc886..4b6ada07d 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; +import org.w3c.css.om.unit.CSSUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -29,8 +29,10 @@ /** * This class provides an abstract implementation of the ValueManager interface. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public abstract class AbstractValueManager extends AbstractValueFactory implements ValueManager { @@ -43,11 +45,8 @@ public Value createFloatValue(short unitType, float floatValue) throws DOMExcept throw createDOMException(); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { throw createDOMException(); } @@ -59,12 +58,31 @@ public Value createStringValue(short type, String value, CSSEngine engine) throw public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { - if ((value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) - && (value.getPrimitiveType() == CSSPrimitiveValue.CSS_URI)) { - // Reveal the absolute value as the cssText now. - return new URIValue(value.getStringValue(), value.getStringValue()); + if (value.getPrimitiveType() == Type.URI) { + // For performance, set the parsed value as the cssText now. + String uri = value.getURIValue(); + return new URIValue(uri, uri); } + return value; } + protected float lengthValue(Value cv) { + short unit = cv.getCSSUnit(); + if (!CSSUnit.isLengthUnitType(unit) && unit != CSSUnit.CSS_NUMBER) { + throw createDOMException(unit); + } + return cv.getFloatValue(); + } + + /** + * Creates an INVALID_ACCESS_ERR exception. + * @param unit the unit. + */ + protected DOMException createDOMException(int unit) { + Object[] p = { unit }; + String s = Messages.formatMessage("invalid.value.access", p); + return new DOMException(DOMException.INVALID_ACCESS_ERR, s); + } + } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueModificationHandler.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueModificationHandler.java new file mode 100644 index 000000000..1eac5ce13 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/AbstractValueModificationHandler.java @@ -0,0 +1,64 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.dom.DOMException; + +/** + * Base class for modification handlers. + */ +public abstract class AbstractValueModificationHandler implements ValueModificationHandler { + + /** + * Creates a new AbstractValueModificationHandler. + */ + protected AbstractValueModificationHandler() { + super(); + } + + /** + * Returns the associated value. + */ + protected abstract Value getValue(); + + /** + * Called when the value has changed. + * + * @param v the value that changed. + */ + @Override + public void valueChanged(Value v) throws DOMException { + propertyTextChanged(); + } + + /** + * To trigger a full property set. + */ + protected void propertyTextChanged() throws DOMException { + setPropertyText(getValue().getCssText()); + } + + /** + * To trigger a full property reparse. + * + * @param text the property serialization. + */ + protected abstract void setPropertyText(String text) throws DOMException; + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ColorFunction.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ColorFunction.java new file mode 100644 index 000000000..a336e248b --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ColorFunction.java @@ -0,0 +1,189 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import java.util.HashSet; +import java.util.Locale; +import java.util.Set; + +import org.w3c.api.DOMSyntaxException; +import org.w3c.css.om.typed.CSSColor; +import org.w3c.css.om.typed.CSSStyleValueList; +import org.w3c.dom.DOMException; + +import org.w3c.css.om.unit.CSSUnit; + +/** + * color() function. + * + * @author See Git history. + * @version $Id$ + */ +public class ColorFunction extends ColorValue implements CSSColor { + + private IdentValue colorSpace; + + /** + * The channels. + */ + private AbstractValueList channels; + + private static final Set predefinedSpaces; + + static { + predefinedSpaces = new HashSet<>(9); + predefinedSpaces.add(ColorValue.CS_SRGB); + predefinedSpaces.add(ColorValue.CS_SRGB_LINEAR); + predefinedSpaces.add(ColorValue.CS_A98_RGB); + predefinedSpaces.add(ColorValue.CS_DISPLAY_P3); + predefinedSpaces.add(ColorValue.CS_PROPHOTO_RGB); + predefinedSpaces.add(ColorValue.CS_REC2020); + predefinedSpaces.add(ColorValue.CS_XYZ); + predefinedSpaces.add(ColorValue.CS_XYZ_D50); + predefinedSpaces.add(ColorValue.CS_XYZ_D65); + } + + /** + * Creates a new ColorFunction. + * + * @param colorSpace the color space. + * @param channels a channel list to copy from. + * @throws DOMSyntaxException if a supplied component is invalid. + */ + public ColorFunction(String colorSpace, CSSStyleValueList channels) + throws DOMSyntaxException { + super(); + this.colorSpace = new IdentValue(canonicalName(colorSpace)); + componentize(this.colorSpace); + componentizeChannels(channels); + } + + private void componentizeChannels(CSSStyleValueList channels) { + // Clone channels if the list belongs to some other value + boolean clone = channels instanceof AbstractValue && ((AbstractValue) channels).handler != null; + int len = channels.getLength(); + this.channels = new AbstractValueList(' ', len); + for (NumericValue channel : channels) { + if (clone) { + channel = channel.clone(); + } + this.channels.add(numericComponent(channel)); + } + componentize(this.channels); + } + + /** + * Get the color space as defined by the Typed OM specification. + * + * @return the color space. + */ + @Override + public IdentValue getColorSpace() { + return colorSpace; + } + + @Override + public String getCSSColorSpace() { + return colorSpace.getValue(); + } + + @Override + public void setColorSpace(String cs) { + colorSpace.setValue(canonicalName(cs)); + componentChanged(colorSpace); + } + + static String canonicalName(String cs) throws DOMException { + cs = cs.toLowerCase(Locale.ROOT); + if (!predefinedSpaces.contains(cs)) { + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, + "Unsupported color space: " + cs); + } + return cs; + } + + @Override + public CSSStyleValueList getChannels() { + return channels; + } + + @Override + public int getLength() throws DOMException { + return channels.getLength() + 2; + } + + @Override + public Value item(int index) throws DOMException { + if (index == 0) { + return getColorSpace(); + } else if (index == channels.getLength() + 1) { + return getAlpha(); + } + return channels.item(index - 1); + } + + @Override + public ColorFunction getColorValue() { + return this; + } + + /** + * A string representation of the current value. + */ + @Override + public String getCssText() { + StringBuilder buf = new StringBuilder(15 + colorSpace.value.length() + channels.getLength() * 8); + buf.append("color(").append(colorSpace.getCssText()); + for (NumericValue ch : channels) { + buf.append(' ').append(ch.getCssText()); + } + if (!isOpaque()) { + buf.append(" / ").append(getAlpha().getCssText()); + } + buf.append(')'); + return buf.toString(); + } + + /** + * Initialize a numeric component of this value. + * + * @param ch the component. + * @return the initialized component. + * @throws DOMSyntaxException if the value is inadequate for a component. + */ + private NumericValue numericComponent(NumericValue ch) throws DOMSyntaxException { + if (ch.getCSSUnit() != CSSUnit.CSS_PERCENTAGE && ch.getCSSUnit() != CSSUnit.CSS_NUMBER) { + throw new DOMSyntaxException("color() component must be a number or percentage."); + } + componentize(ch); + return ch; + } + + @Override + public ColorFunction clone() { + ColorFunction clon; + try { + clon = new ColorFunction(getColorSpace().getValue(), this.channels); + } catch (DOMSyntaxException e) { + clon = null; + } + return clon; + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ColorValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ColorValue.java new file mode 100644 index 000000000..02e2addce --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ColorValue.java @@ -0,0 +1,164 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.api.DOMSyntaxException; +import org.w3c.css.om.typed.CSSColorValue; +import org.w3c.css.om.typed.CSSNumericValue; +import org.w3c.css.om.unit.CSSUnit; + +/** + * CSS colors. + * + * @author See Git history. + * @version $Id$ + */ +public abstract class ColorValue extends ComponentValue implements CSSColorValue { + + public static final String RGB_FUNCTION = "rgb"; + + public static final String CS_SRGB = "srgb"; + + public static final String LAB = "lab"; + + public static final String LCH = "lch"; + + public static final String CS_DISPLAY_P3 = "display-p3"; + + public static final String CS_SRGB_LINEAR = "srgb-linear"; + + public static final String CS_A98_RGB = "a98-rgb"; + + public static final String CS_PROPHOTO_RGB = "prophoto-rgb"; + + public static final String CS_REC2020 = "rec2020"; + + /** + * The {@code xyz-d50} color space. + */ + public static final String CS_XYZ_D50 = "xyz-d50"; + + /** + * The {@code xyz-d65} color space (same as {@code xyz}). + */ + public static final String CS_XYZ_D65 = "xyz-d65"; + + /** + * The {@code xyz} color space (same as {@code xyz-d65}). + */ + public static final String CS_XYZ = "xyz"; + + /** + * The alpha channel. + */ + protected NumericValue alpha; + + /** + * Creates a new RGBColorValue. + */ + protected ColorValue() { + } + + /** + * Creates a new RGBColorValue. + * + * @param a the alpha channel. + * @throws DOMSyntaxException if the value is an invalid opacity. + */ + protected ColorValue(NumericValue a) throws DOMSyntaxException { + super(); + setAlpha(a); + } + + /** + * The type of the value. + */ + @Override + public Type getPrimitiveType() { + return Type.COLOR; + } + + /** + * Get the color space as defined by the Typed OM specification. + * + * @return the color space. + */ + public abstract String getCSSColorSpace(); + + /** + * Gets the value of the {@code alpha} component. + * + * @return the {@code alpha} component. + */ + public NumericValue getAlpha() { + return alpha; + } + + /** + * Sets the alpha channel as a percentage. + * + * @param alpha the alpha channel as a percentage. + */ + public void setAlpha(double alpha) { + this.alpha = new FloatValue(CSSUnit.CSS_PERCENTAGE, (float) alpha * 100); + componentize(this.alpha); + + componentChanged(this.alpha); + } + + /** + * Sets the alpha channel. + * + * @param alpha the alpha channel. + * @throws DOMSyntaxException if alpha is not a percentage. + */ + public void setAlpha(CSSNumericValue alpha) throws DOMSyntaxException { + NumericValue a = (NumericValue) alpha; + if (a.getCSSUnit() != CSSUnit.CSS_PERCENTAGE && a.getCSSUnit() != CSSUnit.CSS_NUMBER) { + throw new DOMSyntaxException("Alpha channel must be a number or percentage."); + } + componentize(a); + this.alpha = a; + + componentChanged(a); + } + + boolean isOpaque() { + switch (alpha.getCSSUnit()) { + case CSSUnit.CSS_NUMBER: + return alpha.getFloatValue() == 1f; + case CSSUnit.CSS_PERCENTAGE: + return alpha.getFloatValue() == 100f; + } + return false; + } + + @Override + public ColorValue getColorValue() { + return this; + } + + @Override + public ColorValue clone() { + ColorValue c = (ColorValue) super.clone(); + c.alpha = alpha.clone(); + return c; + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComponentHandler.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComponentHandler.java new file mode 100644 index 000000000..cf4a84edb --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComponentHandler.java @@ -0,0 +1,61 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.dom.DOMException; + +/** + * Manage the modification of value components. + */ +public interface ComponentHandler extends ValueModificationHandler { + + /** + * Notify that a component of this value changed. + * + * @param c the modified value. + */ + void componentChanged(Value c); + + /** + * Notify that a component was added to this value. + * + * @param c the new value. + */ + void componentAdded(Value c); + + /** + * Notify that a component was removed from this value. + * + * @param c the removed value. + */ + void componentRemoved(Value c); + + /** + * Called when a list value has changed. + */ + void listValueChanged(int index, Value value) throws DOMException; + + /** + * Get the value that owns the components (a list, a color, etc). + * + * @return the main value. + */ + Value getValue(); + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComponentValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComponentValue.java new file mode 100644 index 000000000..bdb09ea64 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComponentValue.java @@ -0,0 +1,96 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.dom.DOMException; + +/** + * A Value made of components. + * + * @version $Id$ + */ +public abstract class ComponentValue extends AbstractValue { + + private ComponentModificationHandler componentHandler = new ComponentModificationHandler(); + + protected ComponentValue() { + super(); + } + + protected ComponentModificationHandler getComponentHandler() { + return componentHandler; + } + + protected void componentize(Value value) { + value.setModificationHandler(componentHandler); + } + + protected void componentChanged(Value v) { + componentHandler.componentChanged(v); + } + + protected void componentAdded(Value v) { + componentHandler.componentAdded(v); + } + + protected void componentRemoved(Value v) { + componentHandler.componentRemoved(v); + } + + class ComponentModificationHandler implements ComponentHandler { + + @Override + public void componentChanged(Value c) { + propertyChanged(); + } + + @Override + public void componentAdded(Value c) { + propertyChanged(); + } + + @Override + public void componentRemoved(Value c) { + propertyChanged(); + } + + @Override + public void listValueChanged(int index, Value value) throws DOMException { + propertyChanged(); + } + + @Override + public void valueChanged(Value v) { + propertyChanged(); + } + + private void propertyChanged() { + if (handler != null) { + handler.valueChanged(getValue()); + } + } + + @Override + public Value getValue() { + return ComponentValue.this; + } + + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComputedValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComputedValue.java index 173550a90..0fb8ed4b4 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComputedValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ComputedValue.java @@ -18,13 +18,15 @@ */ package io.sf.carte.echosvg.css.engine.value; +import org.w3c.css.om.typed.CSSCounterValue; import org.w3c.dom.DOMException; /** * This class represents a computed property value. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. See Git history. + *

* @version $Id$ */ public class ComputedValue implements Value { @@ -77,137 +79,95 @@ public String getCssText() { return computedValue.getCssText(); } - /** - * Implements {@link Value#getCssValueType()}. - */ @Override - public short getCssValueType() { + public CssType getCssValueType() { return computedValue.getCssValueType(); } - /** - * Implements {@link Value#getPrimitiveType()}. - */ + @Override - public short getPrimitiveType() { + public Type getPrimitiveType() { return computedValue.getPrimitiveType(); } - /** - * Implements {@link Value#getFloatValue()}. - */ @Override - public float getFloatValue() throws DOMException { - return computedValue.getFloatValue(); + public short getCSSUnit() { + return computedValue.getCSSUnit(); } - /** - * Implements {@link Value#getStringValue()}. - */ @Override - public String getStringValue() throws DOMException { - return computedValue.getStringValue(); + public void setFloatValue(float value) throws DOMException { + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "Cannot modify computed value."); } - /** - * Implements {@link Value#getRed()}. - */ @Override - public Value getRed() throws DOMException { - return computedValue.getRed(); + public void setModificationHandler(ValueModificationHandler handler) { + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "Cannot modify computed value."); } - /** - * Implements {@link Value#getGreen()}. - */ @Override - public Value getGreen() throws DOMException { - return computedValue.getGreen(); + public ValueModificationHandler getModificationHandler() { + return computedValue.getModificationHandler(); } - /** - * Implements {@link Value#getBlue()}. - */ @Override - public Value getBlue() throws DOMException { - return computedValue.getBlue(); + public float getFloatValue() throws DOMException { + return computedValue.getFloatValue(); } @Override - public Value getAlpha() throws DOMException { - return computedValue.getAlpha(); + public String getIdentifierValue() throws DOMException { + return computedValue.getIdentifierValue(); } /** - * Implements {@link Value#getLength()}. + * Implements {@link Value#getStringValue()}. */ @Override - public int getLength() throws DOMException { - return computedValue.getLength(); + public String getStringValue() throws DOMException { + return computedValue.getStringValue(); } - /** - * Implements {@link Value#item(int)}. - */ @Override - public Value item(int index) throws DOMException { - return computedValue.item(index); + public String getURIValue() throws DOMException { + return computedValue.getURIValue(); } - /** - * Implements {@link Value#getTop()}. - */ @Override - public Value getTop() throws DOMException { - return computedValue.getTop(); + public void setCssText(String cssText) throws DOMException { + throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "Cannot modify computed value."); } - /** - * Implements {@link Value#getRight()}. - */ @Override - public Value getRight() throws DOMException { - return computedValue.getRight(); + public int getLength() throws DOMException { + return computedValue.getLength(); } - /** - * Implements {@link Value#getBottom()}. - */ @Override - public Value getBottom() throws DOMException { - return computedValue.getBottom(); + public Value item(int index) throws DOMException { + return computedValue.item(index); } - /** - * Implements {@link Value#getLeft()}. - */ @Override - public Value getLeft() throws DOMException { - return computedValue.getLeft(); + public CSSCounterValue getCounterValue() throws DOMException { + return computedValue.getCounterValue(); } - /** - * Implements {@link Value#getIdentifier()}. - */ @Override - public String getIdentifier() throws DOMException { - return computedValue.getIdentifier(); + public RectValue getRectValue() throws DOMException { + return computedValue.getRectValue(); } - /** - * Implements {@link Value#getListStyle()}. - */ @Override - public String getListStyle() throws DOMException { - return computedValue.getListStyle(); + public ColorValue getColorValue() throws DOMException { + return computedValue.getColorValue(); } - /** - * Implements {@link Value#getSeparator()}. - */ @Override - public String getSeparator() throws DOMException { - return computedValue.getSeparator(); + public ComputedValue clone() { + ComputedValue cv = new ComputedValue(cascadedValue); + cv.setComputedValue(computedValue); + return cv; } } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/CounterValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/CounterValue.java new file mode 100644 index 000000000..1f3592eea --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/CounterValue.java @@ -0,0 +1,65 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.dom.DOMException; + +/** + * counter() function. + * + */ +class CounterValue extends AbstractCounterValue { + + public CounterValue() { + super(); + } + + CounterValue(String identifier, Value listStyle) { + super(identifier, listStyle); + } + + @Override + public CounterValue clone() { + return new CounterValue(getName(), getCounterStyle()); + } + + @Override + public Type getPrimitiveType() { + return Type.COUNTER; + } + + @Override + public String getCssText() { + StringBuilder buf = new StringBuilder(); + buf.append("counter(").append(getName()); + Value style = getCounterStyle(); + String listStyle; + if (style != null && !"decimal".equalsIgnoreCase(listStyle = style.getCssText())) { + buf.append(',').append(' ').append(listStyle); + } + buf.append(')'); + return buf.toString(); + } + + @Override + public CounterValue getCounterValue() throws DOMException { + return this; + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/CountersValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/CountersValue.java new file mode 100644 index 000000000..9d1b9ee05 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/CountersValue.java @@ -0,0 +1,77 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.dom.DOMException; + +/** + * counters() function. + * + */ +class CountersValue extends AbstractCounterValue { + + private String separator = ""; + + public CountersValue() { + super(); + } + + CountersValue(String identifier, Value listStyle, String separator) { + super(identifier, listStyle); + this.separator = separator; + } + + @Override + public CountersValue clone() { + return new CountersValue(getName(), getCounterStyle(), getSeparator()); + } + + @Override + public Type getPrimitiveType() { + return Type.COUNTERS; + } + + @Override + public String getSeparator() { + return separator; + } + + public void setSeparator(String separator) { + this.separator = separator; + } + + @Override + public String getCssText() { + StringBuilder buf = new StringBuilder(); + buf.append("counter(").append(getName()); + Value style = getCounterStyle(); + String listStyle; + if (style != null && !"decimal".equalsIgnoreCase(listStyle = style.getCssText())) { + buf.append(',').append(' ').append(listStyle); + } + buf.append(')'); + return buf.toString(); + } + + @Override + public CountersValue getCounterValue() throws DOMException { + return this; + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/FloatValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/FloatValue.java index 400834715..d5d0a4ff2 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/FloatValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/FloatValue.java @@ -18,47 +18,53 @@ */ package io.sf.carte.echosvg.css.engine.value; +import java.io.IOException; +import java.io.StringReader; +import java.util.Objects; + +import org.w3c.api.DOMSyntaxException; +import org.w3c.api.DOMTypeException; +import org.w3c.css.om.typed.CSSUnitValue; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; + +import io.sf.carte.doc.style.css.nsac.CSSParseException; +import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.doc.style.css.parser.CSSParser; +import io.sf.carte.doc.style.css.parser.ParseHelper; +import io.sf.carte.doc.style.css.property.NumberValue; /** * This class represents float values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + * @author See Git history. * @version $Id$ */ -public class FloatValue extends AbstractValue { +public class FloatValue extends NumericValue implements CSSUnitValue { /** * Returns the CSS text associated with the given type/value pair. */ public static String getCssText(short unit, float value) { - if (unit < 0 || unit >= UNITS.length) { + if (unit == CSSUnit.CSS_INVALID) { throw new DOMException(DOMException.SYNTAX_ERR, ""); } String s = String.valueOf(value); if (s.endsWith(".0")) { s = s.substring(0, s.length() - 2); } - return s + UNITS[unit - CSSPrimitiveValue.CSS_NUMBER]; + return s + CSSUnit.dimensionUnitString(unit); } - /** - * The unit types representations - */ - protected static final String[] UNITS = { "", "%", "em", "ex", "px", "cm", "mm", "in", "pt", "pc", "deg", "rad", - "grad", "ms", "s", "Hz", "kHz", "" }; - /** * The float value */ - protected float floatValue; + private float floatValue; /** * The unit type */ - protected short unitType; + private short unitType; /** * Creates a new value. @@ -72,7 +78,12 @@ public FloatValue(short unitType, float floatValue) { * The type of the value. */ @Override - public short getPrimitiveType() { + public Type getPrimitiveType() { + return Type.NUMERIC; + } + + @Override + public short getCSSUnit() { return unitType; } @@ -84,6 +95,29 @@ public float getFloatValue() { return floatValue; } + @Override + public double getValue() { + return floatValue; + } + + @Override + public void setValue(double value) { + this.floatValue = (float) value; + + if (handler != null) { + handler.valueChanged(this); + } + } + + public void setValue(String cssText) throws DOMException { + setCssText(cssText); + } + + @Override + public String getUnit() { + return CSSUnit.dimensionUnitString(unitType); + } + /** * A string representation of the current value. */ @@ -92,6 +126,44 @@ public String getCssText() { return getCssText(unitType, floatValue); } + @Override + public void setCssText(String cssText) throws DOMException { + CSSParser parser = new CSSParser(); + try { + LexicalUnit lu = parser.parsePropertyValue(new StringReader(cssText)); + if (lu.getNextLexicalUnit() != null) { + throw new DOMSyntaxException("Invalid number " + cssText); + } + switch (lu.getLexicalUnitType()) { + case INTEGER: + floatValue = lu.getIntegerValue(); + unitType = CSSUnit.CSS_NUMBER; + break; + case REAL: + floatValue = lu.getFloatValue(); + unitType = CSSUnit.CSS_NUMBER; + break; + case PERCENTAGE: + floatValue = lu.getFloatValue(); + unitType = CSSUnit.CSS_PERCENTAGE; + break; + case DIMENSION: + floatValue = lu.getFloatValue(); + unitType = lu.getCssUnit(); + break; + default: + throw new DOMTypeException("Invalid unit value: " + cssText); + } + } catch (IOException e) { + } catch (CSSParseException e) { + throw new DOMSyntaxException(e); + } + + if (handler != null) { + handler.valueChanged(this); + } + } + /** * Returns a printable representation of this value. */ @@ -100,4 +172,103 @@ public String toString() { return getCssText(); } + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + Objects.hash(floatValue, unitType); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (!(obj instanceof Value)) + return false; + Value other = (Value) obj; + return other.getCSSUnit() == unitType + && Float.floatToIntBits(floatValue) == Float.floatToIntBits(other.getFloatValue()); + } + + @Override + public CSSUnitValue to(String unit) { + short destUnit = ParseHelper.unitFromString(unit); + float destValue = NumberValue.floatValueConversion(floatValue, unitType, destUnit); + FloatValue toVal = new FloatValue(destUnit, destValue); + return toVal; + } + + @Override + public CSSNumericType type() { + return new NumericType(); + } + + class NumericType implements CSSNumericType { + + @Override + public int getLength() { + return CSSUnit.isLengthUnitType(unitType) ? 1 : 0; + } + + @Override + public int getAngle() { + return CSSUnit.isAngleUnitType(unitType) ? 1 : 0; + } + + @Override + public int getTime() { + return CSSUnit.isTimeUnitType(unitType) ? 1 : 0; + } + + @Override + public int getFrequency() { + return unitType == CSSUnit.CSS_HZ || unitType == CSSUnit.CSS_KHZ ? 1 : 0; + } + + @Override + public int getResolution() { + return CSSUnit.isResolutionUnitType(unitType) ? 1 : 0; + } + + @Override + public int getFlex() { + return unitType == CSSUnit.CSS_FR ? 1 : 0; + } + + @Override + public int getPercent() { + return unitType == CSSUnit.CSS_PERCENTAGE ? 1 : 0; + } + + @Override + public CSSNumericBaseType getPercentHint() { + CSSNumericBaseType baseType = null; + if (CSSUnit.isLengthUnitType(unitType)) { + baseType = CSSNumericBaseType.length; + } else if (unitType == CSSUnit.CSS_PERCENTAGE) { + baseType = CSSNumericBaseType.percent; + } else if (CSSUnit.isTimeUnitType(unitType)) { + baseType = CSSNumericBaseType.time; + } else if (CSSUnit.isAngleUnitType(unitType)) { + baseType = CSSNumericBaseType.angle; + } else if (CSSUnit.isResolutionUnitType(unitType)) { + baseType = CSSNumericBaseType.resolution; + } else if (unitType == CSSUnit.CSS_HZ || unitType == CSSUnit.CSS_KHZ) { + baseType = CSSNumericBaseType.frequency; + } else if (unitType == CSSUnit.CSS_FR) { + baseType = CSSNumericBaseType.flex; + } + return baseType; + } + + } + + @Override + public FloatValue clone() { + return new FloatValue(unitType, floatValue); + } + } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/IdentValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/IdentValue.java new file mode 100644 index 000000000..b83fad064 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/IdentValue.java @@ -0,0 +1,85 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.css.om.typed.CSSKeywordValue; + +import io.sf.carte.doc.style.css.parser.ParseHelper; + +/** + * Identifier values. + * + * @author See Git history. + * @version $Id$ + */ +public class IdentValue extends AbstractStringValue implements CSSKeywordValue { + + /** + * Creates a new IdentValue. + */ + public IdentValue(String s) { + super(s); + } + + /** + * The type of the value. + */ + @Override + public Type getPrimitiveType() { + return Type.IDENT; + } + + /** + * Indicates whether some other object is "equal to" this one. + * + * @param obj the reference object with which to compare. + */ + @Override + public boolean equals(Object obj) { + if (obj == null || !(obj instanceof Value)) { + return false; + } + Value v = (Value) obj; + return v.getPrimitiveType() == Type.IDENT && value.equals(v.getIdentifierValue()); + } + + /** + * A string representation of the current value. + */ + @Override + public String getCssText() { + return ParseHelper.escape(value); + } + + @Override + public String getIdentifierValue() { + return value; + } + + @Override + public String getStringValue() { + return value; + } + + @Override + public IdentValue clone() { + return new IdentValue(value); + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/IdentifierManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/IdentifierManager.java index 5185fb45f..b348cacb7 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/IdentifierManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/IdentifierManager.java @@ -19,17 +19,19 @@ package io.sf.carte.echosvg.css.engine.value; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; /** * This class provides a manager for the property with support for identifier * values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public abstract class IdentifierManager extends AbstractValueManager { @@ -56,12 +58,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { } } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } Object v = getIdentifiers().get(value.toLowerCase().intern()); diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/InheritValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/InheritValue.java index acc026f0a..3b036b598 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/InheritValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/InheritValue.java @@ -18,16 +18,19 @@ */ package io.sf.carte.echosvg.css.engine.value; -import org.w3c.dom.css.CSSValue; +import org.w3c.api.DOMTypeException; +import org.w3c.css.om.typed.CSSKeywordValue; /** * This singleton class represents the 'inherit' value. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ -public class InheritValue extends AbstractValue { +public class InheritValue extends AbstractValue implements CSSKeywordValue { /** * The only instance of this class. @@ -45,15 +48,35 @@ protected InheritValue() { */ @Override public String getCssText() { + return getValue(); + } + + @Override + public String getValue() { return "inherit"; } + @Override + public void setValue(String value) throws DOMTypeException { + throw new DOMTypeException("Not supported."); + } + /** * A code defining the type of the value. */ @Override - public short getCssValueType() { - return CSSValue.CSS_INHERIT; + public CssType getCssValueType() { + return CssType.KEYWORD; + } + + @Override + public Type getPrimitiveType() { + return Type.INHERIT; + } + + @Override + public InheritValue clone() { + return INSTANCE; } /** diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LCHColorValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LCHColorValue.java new file mode 100644 index 000000000..52d79fa6b --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LCHColorValue.java @@ -0,0 +1,207 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.api.DOMSyntaxException; +import org.w3c.css.om.typed.CSSLCH; +import org.w3c.css.om.typed.CSSNumericValue; +import org.w3c.dom.DOMException; + +import org.w3c.css.om.unit.CSSUnit; +import io.sf.carte.echosvg.css.engine.value.svg.SVGValueConstants; + +/** + * LCH colors. + * + * @version $Id$ + */ +public class LCHColorValue extends ColorValue implements CSSLCH { + + /** + * The lightness component. + */ + protected NumericValue l; + + /** + * The chroma component. + */ + protected NumericValue c; + + /** + * The hue component. + */ + protected NumericValue h; + + /** + * Creates a new, opaque LCHColorValue. + * + * @throws DOMSyntaxException if a supplied component is invalid. + */ + public LCHColorValue(NumericValue l, NumericValue c, NumericValue h) throws DOMSyntaxException { + this(l, c, h, SVGValueConstants.NUMBER_1); + } + + /** + * Creates a new LCHColorValue. + * + * @throws DOMSyntaxException if a supplied component is invalid. + */ + public LCHColorValue(NumericValue l, NumericValue c, NumericValue h, NumericValue alpha) + throws DOMSyntaxException { + super(alpha); + setL(l); + setC(c); + setH(h); + } + + @Override + public String getCSSColorSpace() { + return ColorValue.LCH; + } + + @Override + public String getCssText() { + StringBuilder buf = new StringBuilder(); + buf.append("lch(").append(l.getCssText()).append(' ').append(c.getCssText()).append(' ') + .append(h.getCssText()); + if (!isOpaque()) { + buf.append(' ').append(getAlpha().getCssText()); + } + buf.append(')'); + return buf.toString(); + } + + @Override + public NumericValue getL() { + return l; + } + + @Override + public NumericValue getC() { + return c; + } + + @Override + public NumericValue getH() { + return h; + } + + @Override + public void setL(double lightness) { + l = new FloatValue(CSSUnit.CSS_PERCENTAGE, (float) lightness); + componentize(l); + componentChanged(l); + } + + @Override + public void setL(CSSNumericValue lightness) throws DOMSyntaxException { + l = component(lightness); + componentChanged(l); + } + + /** + * Initialize a component of this value. + * + * @param c the component. + * @return the initialized component. + * @throws DOMSyntaxException if the value is inadequate for a component. + */ + private NumericValue component(CSSNumericValue c) throws DOMSyntaxException { + NumericValue ch = (NumericValue) c; + if (ch.getCSSUnit() != CSSUnit.CSS_PERCENTAGE && ch.getCSSUnit() != CSSUnit.CSS_NUMBER) { + throw new DOMSyntaxException("LC component must be a number or percentage."); + } + if (ch.handler != null) { + ch = ch.clone(); + } + componentize(ch); + return ch; + } + + @Override + public void setC(double c) { + this.c = new FloatValue(CSSUnit.CSS_PERCENTAGE, (float) c); + componentize(this.c); + componentChanged(this.c); + } + + @Override + public void setC(CSSNumericValue c) throws DOMSyntaxException { + this.c = component(c); + componentChanged(this.c); + } + + @Override + public void setH(double h) { + this.h = new FloatValue(CSSUnit.CSS_DEG, (float) h); + componentize(this.h); + componentChanged(this.h); + } + + @Override + public void setH(CSSNumericValue h) throws DOMSyntaxException { + this.h = hueComponent(h); + componentChanged(this.h); + } + + private NumericValue hueComponent(CSSNumericValue h) { + NumericValue ch = (NumericValue) h; + if (ch.getCSSUnit() != CSSUnit.CSS_NUMBER && !CSSUnit.isAngleUnitType(ch.getCSSUnit())) { + throw new DOMSyntaxException("Hue component must be a number or angle."); + } + if (ch.handler != null) { + ch = ch.clone(); + } + componentize(ch); + return ch; + } + + @Override + public int getLength() throws DOMException { + return 4; + } + + @Override + public Value item(int index) throws DOMException { + switch (index) { + case 0: + return getL(); + case 1: + return getC(); + case 2: + return getH(); + case 3: + return getAlpha(); + default: + return null; + } + } + + @Override + public LCHColorValue clone() { + LCHColorValue clon; + try { + clon = new LCHColorValue(l, c, h, alpha); + } catch (DOMSyntaxException e) { + clon = null; + } + return clon; + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LabColorValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LabColorValue.java new file mode 100644 index 000000000..edf8eb465 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LabColorValue.java @@ -0,0 +1,195 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.api.DOMSyntaxException; +import org.w3c.css.om.typed.CSSLab; +import org.w3c.css.om.typed.CSSNumericValue; +import org.w3c.dom.DOMException; + +import org.w3c.css.om.unit.CSSUnit; +import io.sf.carte.echosvg.css.engine.value.svg.SVGValueConstants; + +/** + * Lab colors. + * + * @version $Id$ + */ +public class LabColorValue extends ColorValue implements CSSLab { + + /** + * The lightness component. + */ + protected NumericValue l; + + /** + * The a component. + */ + protected NumericValue a; + + /** + * The b component. + */ + protected NumericValue b; + + /** + * Creates a new, opaque LabColorValue. + * + * @throws DOMSyntaxException if a supplied component is invalid. + */ + public LabColorValue(NumericValue l, NumericValue a, NumericValue b) throws DOMSyntaxException { + this(l, a, b, SVGValueConstants.NUMBER_1); + } + + /** + * Creates a new LabColorValue. + * + * @throws DOMSyntaxException if a supplied component is invalid. + */ + public LabColorValue(NumericValue l, NumericValue a, NumericValue b, NumericValue alpha) + throws DOMSyntaxException { + super(alpha); + setL(l); + setA(a); + setB(b); + } + + @Override + public String getCSSColorSpace() { + return ColorValue.LAB; + } + + @Override + public String getCssText() { + StringBuilder buf = new StringBuilder(); + buf.append("lab(").append(l.getCssText()).append(' ').append(a.getCssText()).append(' ') + .append(b.getCssText()); + if (!isOpaque()) { + buf.append(' ').append(getAlpha().getCssText()); + } + buf.append(')'); + return buf.toString(); + } + + @Override + public NumericValue getL() { + return l; + } + + @Override + public NumericValue getA() { + return a; + } + + @Override + public NumericValue getB() { + return b; + } + + @Override + public void setL(double lightness) { + l = new FloatValue(CSSUnit.CSS_PERCENTAGE, (float) lightness); + componentize(l); + componentChanged(l); + } + + @Override + public void setL(CSSNumericValue lightness) throws DOMSyntaxException { + l = component(lightness); + componentChanged(l); + } + + /** + * Initialize a component of this value. + * + * @param c the component. + * @return the initialized component. + * @throws DOMSyntaxException if the value is inadequate for a component. + */ + private NumericValue component(CSSNumericValue c) throws DOMSyntaxException { + NumericValue ch = (NumericValue) c; + if (ch.getCSSUnit() != CSSUnit.CSS_PERCENTAGE && ch.getCSSUnit() != CSSUnit.CSS_NUMBER) { + throw new DOMSyntaxException("Lab component must be a number or percentage."); + } + if (ch.handler != null) { + ch = ch.clone(); + } + componentize(ch); + return ch; + } + + @Override + public void setA(double a) { + this.a = new FloatValue(CSSUnit.CSS_NUMBER, (float) a); + componentize(this.a); + componentChanged(this.a); + } + + @Override + public void setA(CSSNumericValue a) throws DOMSyntaxException { + this.a = component(a); + componentChanged(this.a); + } + + @Override + public void setB(double b) { + this.b = new FloatValue(CSSUnit.CSS_NUMBER, (float) b); + componentize(this.b); + componentChanged(this.b); + } + + @Override + public void setB(CSSNumericValue b) throws DOMSyntaxException { + this.b = component(b); + componentChanged(this.b); + } + + @Override + public int getLength() throws DOMException { + return 4; + } + + @Override + public Value item(int index) throws DOMException { + switch (index) { + case 0: + return getL(); + case 1: + return getA(); + case 2: + return getB(); + case 3: + return getAlpha(); + default: + return null; + } + } + + @Override + public LabColorValue clone() { + LabColorValue clon; + try { + clon = new LabColorValue(l, a, b, alpha); + } catch (DOMSyntaxException e) { + clon = null; + } + return clon; + } + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LengthManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LengthManager.java index a0927f152..153e68e82 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LengthManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/LengthManager.java @@ -19,11 +19,11 @@ package io.sf.carte.echosvg.css.engine.value; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; -import io.sf.carte.doc.style.css.CSSUnit; +import org.w3c.css.om.unit.CSSUnit; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.doc.style.css.property.NumberValue; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSContext; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; @@ -33,8 +33,10 @@ * This class provides a manager for the property with support for length * values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public abstract class LengthManager extends AbstractValueManager { @@ -58,51 +60,22 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { break; case INTEGER: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getIntegerValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getIntegerValue()); case REAL: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getFloatValue()); case PERCENTAGE: - return new FloatValue(CSSPrimitiveValue.CSS_PERCENTAGE, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_PERCENTAGE, lu.getFloatValue()); default: break; } throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); } - static Value createLength(LexicalUnit lu) { + static FloatValue createLength(LexicalUnit lu) { if (CSSUnit.isLengthUnitType(lu.getCssUnit())) { - short omUnit; - switch (lu.getCssUnit()) { - case CSSUnit.CSS_PX: - omUnit = CSSPrimitiveValue.CSS_PX; - break; - case CSSUnit.CSS_IN: - omUnit = CSSPrimitiveValue.CSS_IN; - break; - case CSSUnit.CSS_PC: - omUnit = CSSPrimitiveValue.CSS_PC; - break; - case CSSUnit.CSS_PT: - omUnit = CSSPrimitiveValue.CSS_PT; - break; - case CSSUnit.CSS_CM: - omUnit = CSSPrimitiveValue.CSS_CM; - break; - case CSSUnit.CSS_MM: - omUnit = CSSPrimitiveValue.CSS_MM; - break; - case CSSUnit.CSS_EM: - omUnit = CSSPrimitiveValue.CSS_EMS; - break; - case CSSUnit.CSS_EX: - omUnit = CSSPrimitiveValue.CSS_EXS; - break; - default: - return null; - } - return new FloatValue(omUnit, lu.getFloatValue()); + return new FloatValue(lu.getCssUnit(), lu.getFloatValue()); } return null; } @@ -113,16 +86,16 @@ static Value createLength(LexicalUnit lu) { @Override public Value createFloatValue(short type, float floatValue) throws DOMException { switch (type) { - case CSSPrimitiveValue.CSS_PERCENTAGE: - case CSSPrimitiveValue.CSS_EMS: - case CSSPrimitiveValue.CSS_EXS: - case CSSPrimitiveValue.CSS_PX: - case CSSPrimitiveValue.CSS_CM: - case CSSPrimitiveValue.CSS_MM: - case CSSPrimitiveValue.CSS_IN: - case CSSPrimitiveValue.CSS_PT: - case CSSPrimitiveValue.CSS_PC: - case CSSPrimitiveValue.CSS_NUMBER: + case CSSUnit.CSS_PERCENTAGE: + case CSSUnit.CSS_EM: + case CSSUnit.CSS_EX: + case CSSUnit.CSS_PX: + case CSSUnit.CSS_CM: + case CSSUnit.CSS_MM: + case CSSUnit.CSS_IN: + case CSSUnit.CSS_PT: + case CSSUnit.CSS_PC: + case CSSUnit.CSS_NUMBER: return new FloatValue(type, floatValue); } throw createInvalidFloatTypeDOMException(type); @@ -135,58 +108,59 @@ public Value createFloatValue(short type, float floatValue) throws DOMException @Override public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { - if (value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE) { + if (value.getPrimitiveType() != Type.NUMERIC) { return value; } - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_NUMBER: - case CSSPrimitiveValue.CSS_PX: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_NUMBER: + case CSSUnit.CSS_PX: return value; - case CSSPrimitiveValue.CSS_MM: + case CSSUnit.CSS_MM: CSSContext ctx = engine.getCSSContext(); float v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v / ctx.getPixelUnitToMillimeter()); + return new FloatValue(CSSUnit.CSS_NUMBER, v / ctx.getPixelUnitToMillimeter()); - case CSSPrimitiveValue.CSS_CM: + case CSSUnit.CSS_CM: ctx = engine.getCSSContext(); v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * 10f / ctx.getPixelUnitToMillimeter()); + return new FloatValue(CSSUnit.CSS_NUMBER, v * 10f / ctx.getPixelUnitToMillimeter()); - case CSSPrimitiveValue.CSS_IN: + case CSSUnit.CSS_IN: ctx = engine.getCSSContext(); v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * 25.4f / ctx.getPixelUnitToMillimeter()); + return new FloatValue(CSSUnit.CSS_NUMBER, v * 25.4f / ctx.getPixelUnitToMillimeter()); - case CSSPrimitiveValue.CSS_PT: + case CSSUnit.CSS_PT: ctx = engine.getCSSContext(); v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * 25.4f / (72f * ctx.getPixelUnitToMillimeter())); + return new FloatValue(CSSUnit.CSS_NUMBER, v * 25.4f / (72f * ctx.getPixelUnitToMillimeter())); - case CSSPrimitiveValue.CSS_PC: + case CSSUnit.CSS_PC: ctx = engine.getCSSContext(); v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, (v * 25.4f / (6f * ctx.getPixelUnitToMillimeter()))); + return new FloatValue(CSSUnit.CSS_NUMBER, (v * 25.4f / (6f * ctx.getPixelUnitToMillimeter()))); - case CSSPrimitiveValue.CSS_EMS: + case CSSUnit.CSS_EM: sm.putFontSizeRelative(idx, true); v = value.getFloatValue(); int fsidx = engine.getFontSizeIndex(); - float fs; - fs = engine.getComputedStyle(elt, pseudo, fsidx).getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * fs); + Value cv = engine.getComputedStyle(elt, pseudo, fsidx); + float fs = lengthValue(cv); + return new FloatValue(CSSUnit.CSS_NUMBER, v * fs); - case CSSPrimitiveValue.CSS_EXS: + case CSSUnit.CSS_EX: sm.putFontSizeRelative(idx, true); v = value.getFloatValue(); fsidx = engine.getFontSizeIndex(); - fs = engine.getComputedStyle(elt, pseudo, fsidx).getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * fs * 0.5f); + cv = engine.getComputedStyle(elt, pseudo, fsidx); + fs = lengthValue(cv); + return new FloatValue(CSSUnit.CSS_NUMBER, v * fs * 0.5f); - case CSSPrimitiveValue.CSS_PERCENTAGE: + case CSSUnit.CSS_PERCENTAGE: ctx = engine.getCSSContext(); switch (getOrientation()) { case HORIZONTAL_ORIENTATION: @@ -204,8 +178,18 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin double h = ctx.getBlockHeight(elt); fs = (float) (value.getFloatValue() * (Math.sqrt(w * w + h * h) / SQRT2) / 100.0); } - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, fs); + return new FloatValue(CSSUnit.CSS_NUMBER, fs); + case CSSUnit.CSS_INVALID: + break; + default: + // Maybe it is one of the new absolute length units + try { + value = new FloatValue(CSSUnit.CSS_NUMBER, + NumberValue.floatValueConversion(value.getFloatValue(), value.getCSSUnit(), CSSUnit.CSS_PX)); + } catch (DOMException e) { + } } + return value; } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ListValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ListValue.java index 7ea0db5b8..d6aabf205 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ListValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ListValue.java @@ -18,111 +18,39 @@ */ package io.sf.carte.echosvg.css.engine.value; -import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSValue; - /** * This class represents a list of values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + * @author See Git history. * @version $Id$ */ -public class ListValue extends AbstractValue { - - /** - * The length of the list. - */ - protected int length; - - /** - * The items. - */ - protected Value[] items = new Value[5]; - - /** - * The list separator. - */ - protected char separator = ','; - +public class ListValue extends AbstractValueList { /** * Creates a ListValue. */ public ListValue() { + super(','); } /** * Creates a ListValue with the given separator. */ public ListValue(char s) { - separator = s; - } - - /** - * Returns the separator used for this list. - */ - public char getSeparatorChar() { - return separator; - } - - /** - * Implements {@link Value#getCssValueType()}. - */ - @Override - public short getCssValueType() { - return CSSValue.CSS_VALUE_LIST; - } - - /** - * A string representation of the current value. - */ - @Override - public String getCssText() { - StringBuilder sb = new StringBuilder(length * 8); - if (length > 0) { - sb.append(items[0].getCssText()); - } - for (int i = 1; i < length; i++) { - sb.append(separator); - sb.append(items[i].getCssText()); - } - return sb.toString(); - } - - /** - * Implements {@link Value#getLength()}. - */ - @Override - public int getLength() throws DOMException { - return length; - } - - /** - * Implements {@link Value#item(int)}. - */ - @Override - public Value item(int index) throws DOMException { - return items[index]; + super(s); } /** - * Returns a printable representation of this value. + * Creates a ListValue with the given separator. */ - @Override - public String toString() { - return getCssText(); + ListValue(char s, int initialCapacity) { + super(s, initialCapacity); } /** * Appends an item to the list. */ public void append(Value v) { - if (length == items.length) { - Value[] t = new Value[length * 2]; - System.arraycopy(items, 0, t, 0, length); - items = t; - } - items[length++] = v; + add(v); } } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/NumericValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/NumericValue.java new file mode 100644 index 000000000..24568e3b5 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/NumericValue.java @@ -0,0 +1,41 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +import org.w3c.css.om.typed.CSSNumericValue; + +/** + * Base class for numeric values. + * + * @author See Git history. + * @version $Id$ + */ +public abstract class NumericValue extends AbstractValue implements CSSNumericValue { + + /** + * Creates a new value. + */ + public NumericValue() { + super(); + } + + @Override + public abstract NumericValue clone(); + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RGBColorValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RGBColorValue.java index b1c86e4f5..b74456ef8 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RGBColorValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RGBColorValue.java @@ -18,63 +18,81 @@ */ package io.sf.carte.echosvg.css.engine.value; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +import org.w3c.api.DOMSyntaxException; +import org.w3c.css.om.typed.CSSNumericValue; +import org.w3c.css.om.typed.CSSRGB; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.echosvg.css.engine.value.svg.SVGValueConstants; /** - * This class represents RGB colors. + * RGB colors. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + * @author See Git history. * @version $Id$ */ -public class RGBColorValue extends AbstractValue { +public class RGBColorValue extends ColorValue implements CSSRGB { /** * The red component. */ - protected Value red; + private NumericValue red; /** * The green component. */ - protected Value green; + private NumericValue green; /** * The blue component. */ - protected Value blue; + private NumericValue blue; /** - * The alpha channel. + * Whether components were specified as percentages */ - protected Value alpha; + private transient boolean pcntSpecified; + + private transient boolean alphaPcntSpecified; /** * Creates a new, opaque RGBColorValue. + * + * @throws DOMSyntaxException if a supplied component is invalid. */ - public RGBColorValue(Value r, Value g, Value b) { + public RGBColorValue(NumericValue r, NumericValue g, NumericValue b) throws DOMSyntaxException { this(r, g, b, SVGValueConstants.NUMBER_1); } /** * Creates a new RGBColorValue. + * + * @throws DOMSyntaxException if a supplied component is invalid. */ - public RGBColorValue(Value r, Value g, Value b, Value a) { - red = r; - green = g; - blue = b; - alpha = a; + public RGBColorValue(NumericValue r, NumericValue g, NumericValue b, NumericValue a) + throws DOMSyntaxException { + super(a); + setR(r); + setG(g); + setB(b); + } + + void setSpecifiedAsPercentage(boolean spec) { + pcntSpecified = spec; + } + + void setAlphaSpecifiedAsPercentage(boolean spec) { + alphaPcntSpecified = spec; } - /** - * The type of the value. - */ @Override - public short getPrimitiveType() { - return CSSPrimitiveValue.CSS_RGBCOLOR; + public String getCSSColorSpace() { + return ColorValue.RGB_FUNCTION; } /** @@ -82,52 +100,189 @@ public short getPrimitiveType() { */ @Override public String getCssText() { - return toString(red.getCssText(), green.getCssText(), blue.getCssText(), alpha.getCssText()); + DecimalFormat df = null; + if (!pcntSpecified || !alphaPcntSpecified) { + DecimalFormatSymbols dfs = new DecimalFormatSymbols(Locale.ROOT); + df = new DecimalFormat("#.#", dfs); + df.setMinimumFractionDigits(0); + df.setMaximumFractionDigits(4); + } + + String sr = rgbComponentText(red, df); + String sg = rgbComponentText(green, df); + String sb = rgbComponentText(blue, df); + + StringBuilder buf = new StringBuilder(sr.length() + sg.length() + sb.length() + 16); + boolean opaque = isOpaque(); + if (opaque) { + buf.append("rgb("); + } else { + buf.append("rgba("); + } + buf.append(sr).append(", ").append(sg).append(", ").append(sb); + if (!opaque) { + buf.append(", ").append(alphaComponentText(alpha, df)); + } + buf.append(')'); + return buf.toString(); + } + + private String rgbComponentText(NumericValue comp, DecimalFormat df) { + if (pcntSpecified || comp.getCSSUnit() == CSSUnit.CSS_NUMBER) { + return comp.getCssText(); + } + + return df.format(comp.getFloatValue() * 2.55f); + } + + private String alphaComponentText(NumericValue alpha, DecimalFormat df) { + if (alphaPcntSpecified || alpha.getCSSUnit() == CSSUnit.CSS_NUMBER) { + return alpha.getCssText(); + } + + return df.format(alpha.getFloatValue() * 0.01f); + } + + @Override + public RGBColorValue getColorValue() { + return this; + } + + @Override + public NumericValue getR() { + return red; + } + + @Override + public NumericValue getG() { + return green; + } + + @Override + public NumericValue getB() { + return blue; } /** - * Implements {@link Value#getRed()}. + * Get the red component. + * + * @return the red component. */ - @Override - public Value getRed() throws DOMException { + public Value getRed() { return red; } /** - * Implements {@link Value#getGreen()}. + * Get the green component. + * + * @return the green component. */ - @Override - public Value getGreen() throws DOMException { + public Value getGreen() { return green; } /** - * Implements {@link Value#getBlue()}. + * Get the blue component. + * + * @return the blue component. */ - @Override - public Value getBlue() throws DOMException { + public Value getBlue() { return blue; } @Override - public Value getAlpha() throws DOMException { - return alpha; + public void setR(double r) { + red = new FloatValue(CSSUnit.CSS_PERCENTAGE, (float) r * 100); + pcntSpecified = true; + componentize(red); + componentChanged(red); + } + + @Override + public void setR(CSSNumericValue r) throws DOMSyntaxException { + red = component(r); + componentChanged(red); + pcntSpecified = red.getCSSUnit() == CSSUnit.CSS_PERCENTAGE; } /** - * Returns a printable representation of the color. + * Initialize a component of this value. + * + * @param c the component. + * @return the initialized component. + * @throws DOMSyntaxException if the value is inadequate for a component. */ + private NumericValue component(CSSNumericValue c) throws DOMSyntaxException { + NumericValue ch = (NumericValue) c; + if (ch.getCSSUnit() != CSSUnit.CSS_PERCENTAGE && ch.getCSSUnit() != CSSUnit.CSS_NUMBER) { + throw new DOMSyntaxException("RGB component must be a number or percentage, not a " + + CSSUnit.dimensionUnitString(ch.getCSSUnit()) + '.'); + } + if (ch.handler != null) { + ch = ch.clone(); + } + componentize(ch); + return ch; + } + @Override - public String toString() { - return getCssText(); + public void setG(double g) { + green = new FloatValue(CSSUnit.CSS_PERCENTAGE, (float) g * 100); + pcntSpecified = true; + componentize(green); + componentChanged(green); } - public static String toString(String red, String green, String blue, String alpha) { - if ("1".equals(alpha)) { - return "rgb(" + red + ", " + green + ", " + blue + ')'; - } else { - return "rgba(" + red + ", " + green + ", " + blue + ", " + alpha + ')'; + @Override + public void setG(CSSNumericValue g) throws DOMSyntaxException { + green = component(g); + componentChanged(green); + } + + @Override + public void setB(double b) { + blue = new FloatValue(CSSUnit.CSS_PERCENTAGE, (float) b * 100); + pcntSpecified = true; + componentize(blue); + componentChanged(blue); + } + + @Override + public void setB(CSSNumericValue b) throws DOMSyntaxException { + blue = component(b); + componentChanged(blue); + } + + @Override + public int getLength() throws DOMException { + return 4; + } + + @Override + public Value item(int index) throws DOMException { + switch (index) { + case 0: + return getR(); + case 1: + return getG(); + case 2: + return getB(); + case 3: + return getAlpha(); + default: + return null; + } + } + + @Override + public RGBColorValue clone() { + RGBColorValue clon; + try { + clon = new RGBColorValue(red, green, blue, alpha); + } catch (DOMSyntaxException e) { + clon = null; } + return clon; } } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RectManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RectManager.java index 9e54138a5..e816010c4 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RectManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RectManager.java @@ -18,11 +18,11 @@ */ package io.sf.carte.echosvg.css.engine.value; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -31,8 +31,11 @@ /** * This class provides a manager for the property with support for rect values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

+ * * @version $Id$ */ public abstract class RectManager extends LengthManager { @@ -88,17 +91,17 @@ private Value createRectComponent(LexicalUnit lu) throws DOMException { } break; case DIMENSION: - Value value = createLength(lu); + NumericValue value = createLength(lu); if (value != null) { return value; } break; case INTEGER: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getIntegerValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getIntegerValue()); case REAL: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getFloatValue()); case PERCENTAGE: - return new FloatValue(CSSPrimitiveValue.CSS_PERCENTAGE, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_PERCENTAGE, lu.getFloatValue()); default: break; } @@ -112,13 +115,11 @@ private Value createRectComponent(LexicalUnit lu) throws DOMException { @Override public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { - if (value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE) { + if (value.getPrimitiveType() != Type.RECT) { return value; } - if (value.getPrimitiveType() != CSSPrimitiveValue.CSS_RECT) { - return value; - } - RectValue rect = (RectValue) value; + + RectValue rect = value.getRectValue(); orientation = VERTICAL_ORIENTATION; Value top = super.computeValue(elt, pseudo, engine, idx, sm, rect.getTop()); @@ -126,7 +127,8 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin orientation = HORIZONTAL_ORIENTATION; Value left = super.computeValue(elt, pseudo, engine, idx, sm, rect.getLeft()); Value right = super.computeValue(elt, pseudo, engine, idx, sm, rect.getRight()); - if (top != rect.getTop() || right != rect.getRight() || bottom != rect.getBottom() || left != rect.getLeft()) { + if (top != rect.getTop() || right != rect.getRight() || bottom != rect.getBottom() + || left != rect.getLeft()) { return new RectValue(top, right, bottom, left); } else { return value; diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RectValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RectValue.java index 14f01aa9b..9505cba4a 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RectValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/RectValue.java @@ -18,17 +18,22 @@ */ package io.sf.carte.echosvg.css.engine.value; +import org.w3c.api.DOMSyntaxException; +import org.w3c.css.om.typed.CSSRectValue; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; + +import org.w3c.css.om.unit.CSSUnit; /** * This class represents CSS rect values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ -public class RectValue extends AbstractValue { +public class RectValue extends ComponentValue implements CSSRectValue { /** * The top value. @@ -54,18 +59,18 @@ public class RectValue extends AbstractValue { * Creates a new Rect value. */ public RectValue(Value t, Value r, Value b, Value l) { - top = t; - right = r; - bottom = b; - left = l; + setTop(t); + setRight(r); + setBottom(b); + setLeft(l); } /** * The type of the value. */ @Override - public short getPrimitiveType() { - return CSSPrimitiveValue.CSS_RECT; + public Type getPrimitiveType() { + return Type.RECT; } /** @@ -77,44 +82,94 @@ public String getCssText() { + left.getCssText() + ')'; } - /** - * Implements {@link Value#getTop()}. - */ @Override public Value getTop() throws DOMException { return top; } - /** - * Implements {@link Value#getRight()}. - */ @Override public Value getRight() throws DOMException { return right; } - /** - * Implements {@link Value#getBottom()}. - */ @Override public Value getBottom() throws DOMException { return bottom; } - /** - * Implements {@link Value#getLeft()}. - */ @Override public Value getLeft() throws DOMException { return left; } + void setTop(Value top) { + this.top = component(top); + } + /** - * Returns a printable representation of this value. + * Initialize a component of this value. + * + * @param c the component. + * @return the initialized component. + * @throws DOMSyntaxException if the value is inadequate for a component. */ + Value component(Value c) throws DOMSyntaxException { + short unit = c.getCSSUnit(); + if (unit != CSSUnit.CSS_PERCENTAGE && unit != CSSUnit.CSS_NUMBER + && !CSSUnit.isLengthUnitType(unit) && c.getPrimitiveType() != Type.IDENT) { + throw new DOMSyntaxException("rect() component must be a length or percentage."); + } + + if (c.getModificationHandler() != null) { + c = ((AbstractValue) c).clone(); + } + componentize(c); + + return c; + } + + void setRight(Value right) { + this.right = component(right); + } + + void setBottom(Value bottom) { + this.bottom = component(bottom); + } + + void setLeft(Value left) { + this.left = component(left); + } + + @Override + public RectValue getRectValue() throws DOMException { + return this; + } + + @Override + public int getLength() throws DOMException { + return 4; + } + + @Override + public Value item(int index) throws DOMException { + switch (index) { + case 0: + return getTop(); + case 1: + return getRight(); + case 2: + return getBottom(); + case 3: + return getLeft(); + default: + return null; + } + } + @Override - public String toString() { - return getCssText(); + public RectValue clone() { + RectValue clon = new RectValue(top, right, bottom, left); + return clon; } } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/StringValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/StringValue.java index 478fab143..47706e301 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/StringValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/StringValue.java @@ -18,64 +18,44 @@ */ package io.sf.carte.echosvg.css.engine.value; -import java.util.Objects; +import org.w3c.css.om.typed.CSSStringValue; -import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; +import io.sf.carte.doc.style.css.parser.ParseHelper; /** * This class represents string values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ -public class StringValue extends AbstractValue { - - /** - * Returns the CSS text associated with the given type/value pair. - */ - public static String getCssText(short type, String value) { - switch (type) { - case CSSPrimitiveValue.CSS_URI: - return "url(" + value + ')'; - - case CSSPrimitiveValue.CSS_STRING: - char q = (value.indexOf('"') != -1) ? '\'' : '"'; - return q + value + q; - } - return value; - } - - /** - * The value of the string - */ - protected String value; - - /** - * The unit type - */ - protected short unitType; +public class StringValue extends AbstractStringValue implements CSSStringValue { /** * Creates a new StringValue. */ - public StringValue(short type, String s) { - unitType = type; - value = s; + public StringValue(String s) { + super(s); } /** * The type of the value. */ @Override - public short getPrimitiveType() { - return unitType; + public Type getPrimitiveType() { + return Type.STRING; + } + + @Override + public String getStringValue() { + return value; } @Override - public int hashCode() { - return Objects.hash(unitType, value); + public String getURIValue() { + return value; } /** @@ -85,14 +65,11 @@ public int hashCode() { */ @Override public boolean equals(Object obj) { - if (obj == null || !(obj instanceof StringValue)) { + if (obj == null || !(obj instanceof Value)) { return false; } - StringValue v = (StringValue) obj; - if (unitType != v.unitType) { - return false; - } - return value.equals(v.value); + Value v = (Value) obj; + return v.getPrimitiveType() == Type.STRING && value.equals(v.getStringValue()); } /** @@ -100,26 +77,12 @@ public boolean equals(Object obj) { */ @Override public String getCssText() { - return getCssText(unitType, value); - } - - /** - * This method is used to get the string value. - * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a string value. - */ - @Override - public String getStringValue() throws DOMException { - return value; + return ParseHelper.quote(value, '\''); } - /** - * Returns a printable representation of this value. - */ @Override - public String toString() { - return getCssText(); + public StringValue clone() { + return new StringValue(value); } } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/URIValue.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/URIValue.java index 130501e11..000614ece 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/URIValue.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/URIValue.java @@ -18,27 +18,56 @@ */ package io.sf.carte.echosvg.css.engine.value; -import org.w3c.dom.css.CSSPrimitiveValue; +import org.w3c.css.om.typed.CSSStringValue; /** - * This class represents uri values. + * This class represents URI values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ -public class URIValue extends StringValue { +public class URIValue extends AbstractStringValue implements CSSStringValue { - String cssText; + private String cssText; /** - * Creates a new StringValue. + * Creates a new URIValue. */ - public URIValue(String cssText, String uri) { - super(CSSPrimitiveValue.CSS_URI, uri); + public URIValue(String cssText, String s) { + super(s); this.cssText = cssText; } + /** + * The type of the value. + */ + @Override + public Type getPrimitiveType() { + return Type.URI; + } + + @Override + public String getURIValue() { + return value; + } + + /** + * Indicates whether some other object is "equal to" this one. + * + * @param obj the reference object with which to compare. + */ + @Override + public boolean equals(Object obj) { + if (obj == null || !(obj instanceof Value)) { + return false; + } + Value v = (Value) obj; + return v.getPrimitiveType() == Type.URI && value.equals(v.getURIValue()); + } + /** * A string representation of the current value. */ @@ -47,4 +76,9 @@ public String getCssText() { return "url(" + cssText + ')'; } + @Override + public URIValue clone() { + return new URIValue(cssText, value); + } + } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/Value.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/Value.java index f0ec16a1f..f0b961e7c 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/Value.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/Value.java @@ -18,153 +18,98 @@ */ package io.sf.carte.echosvg.css.engine.value; +import org.w3c.css.om.typed.CSSCounterValue; import org.w3c.dom.DOMException; +import io.sf.carte.echosvg.css.dom.CSSValue; + /** * This interface represents a property value. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + * @author See Git history. * @version $Id$ */ -public interface Value { - - /** - * A string representation of the current value. - */ - String getCssText(); - - /** - * A code defining the type of the value. - */ - short getCssValueType(); - - /** - * The type of the value. - */ - short getPrimitiveType(); - - /** - * This method is used to get the float value. - * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a float value. - */ - float getFloatValue() throws DOMException; - - /** - * This method is used to get the string value. - * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a string value. - */ - String getStringValue() throws DOMException; - - /** - * The red value of the RGB color. - * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a RGB color value. - */ - Value getRed() throws DOMException; - - /** - * The green value of the RGB color. - * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a RGB color value. - */ - Value getGreen() throws DOMException; - - /** - * The blue value of the RGB color. - * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a RGB color value. - */ - Value getBlue() throws DOMException; - - /** - * The alpha channel value of the RGBA color. - * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a RGB color value. - */ - Value getAlpha() throws DOMException; +public interface Value extends CSSValue { /** - * The number of CSSValues in the list. The range of valid values - * of the indices is 0 to length-1 inclusive. + * Convenience method that either returns an identifier or throws an exception. * * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a list value. + * contain an identifier value. + * @Deprecated use {@link #getgetIdentifierValue()} instead. */ - int getLength() throws DOMException; + @Deprecated + default String getIdentifier() throws DOMException { + return getIdentifierValue(); + } /** - * Used to retrieve a rule by ordinal index. + * If this value is a list, give the item corresponding to the requested index. + * If there is no item at such index, return {@code null} If this object is not + * a list and the index is {@code 0}, return itself. * - * @return The style rule at the index position in the list, or - * null if that is not a valid index. - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a list value. + * @param index the index on the list. + * @return the item, or {@code null} if there is no item on that index. */ - Value item(int index) throws DOMException; + @Override + default Value item(int index) { + return index == 0 ? this : null; + } /** - * The top value of the rect. + * If this value is a counter() or counters() value, get it. * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a Rect value. + * @return the counter() value. + * @throws DOMException INVALID_ACCESS_ERR if this is not a counter() or + * counters() value. */ - Value getTop() throws DOMException; + CSSCounterValue getCounterValue() throws DOMException; /** - * The right value of the rect. + * If this value is a rect() value, get it. * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a Rect value. + * @return the rect() value. + * @throws DOMException INVALID_ACCESS_ERR if this is not a rect() value. */ - Value getRight() throws DOMException; + RectValue getRectValue() throws DOMException; /** - * The bottom value of the rect. + * If this value is a color value, get it. * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a Rect value. + * @return the color value. + * @throws DOMException INVALID_ACCESS_ERR if this is not a color value. */ - Value getBottom() throws DOMException; + ColorValue getColorValue() throws DOMException; /** - * The left value of the rect. + * If this value is a unit value, set the float value. * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a Rect value. + * @param value the new value, in the current unit. + * @throws DOMException if the value is not a unit value. */ - Value getLeft() throws DOMException; + void setFloatValue(float value) throws DOMException; /** - * The identifier value of the counter. + * Set the modification handler. * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a Counter value. + * @param handler the modification handler. */ - String getIdentifier() throws DOMException; + void setModificationHandler(ValueModificationHandler handler); /** - * The listStyle value of the counter. + * Get the modification handler. * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a Counter value. + * @return the modification handler, or {@code null} if there is no handler. */ - String getListStyle() throws DOMException; + ValueModificationHandler getModificationHandler(); /** - * The separator value of the counter. + * Is this value a component? * - * @exception DOMException INVALID_ACCESS_ERR: Raised if the value doesn't - * contain a Counter value. + * @return {@code true} if the value is a component. */ - String getSeparator() throws DOMException; + default boolean isComponent() { + return false; + } } 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 0f39fb26d..da510bb64 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 @@ -18,15 +18,16 @@ */ package io.sf.carte.echosvg.css.engine.value; -import org.w3c.dom.css.CSSPrimitiveValue; - +import org.w3c.css.om.unit.CSSUnit; import io.sf.carte.echosvg.util.CSSConstants; /** * This interface defines constants for CSS values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public interface ValueConstants { @@ -34,67 +35,67 @@ public interface ValueConstants { /** * 0 */ - Value NUMBER_0 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 0); + NumericValue NUMBER_0 = new FloatValue(CSSUnit.CSS_NUMBER, 0); /** * 100 */ - Value NUMBER_100 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 100); + NumericValue NUMBER_100 = new FloatValue(CSSUnit.CSS_NUMBER, 100); /** * 128 */ - Value NUMBER_128 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 128); + NumericValue NUMBER_128 = new FloatValue(CSSUnit.CSS_NUMBER, 128); /** * 192 */ - Value NUMBER_192 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 192); + NumericValue NUMBER_192 = new FloatValue(CSSUnit.CSS_NUMBER, 192); /** * 200 */ - Value NUMBER_200 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 200); + NumericValue NUMBER_200 = new FloatValue(CSSUnit.CSS_NUMBER, 200); /** * 255 */ - Value NUMBER_255 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 255); + NumericValue NUMBER_255 = new FloatValue(CSSUnit.CSS_NUMBER, 255); /** * 300 */ - Value NUMBER_300 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 300); + NumericValue NUMBER_300 = new FloatValue(CSSUnit.CSS_NUMBER, 300); /** * 400 */ - Value NUMBER_400 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 400); + NumericValue NUMBER_400 = new FloatValue(CSSUnit.CSS_NUMBER, 400); /** * 500 */ - Value NUMBER_500 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 500); + NumericValue NUMBER_500 = new FloatValue(CSSUnit.CSS_NUMBER, 500); /** * 600 */ - Value NUMBER_600 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 600); + NumericValue NUMBER_600 = new FloatValue(CSSUnit.CSS_NUMBER, 600); /** * 700 */ - Value NUMBER_700 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 700); + NumericValue NUMBER_700 = new FloatValue(CSSUnit.CSS_NUMBER, 700); /** * 800 */ - Value NUMBER_800 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 800); + NumericValue NUMBER_800 = new FloatValue(CSSUnit.CSS_NUMBER, 800); /** * 900 */ - Value NUMBER_900 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 900); + NumericValue NUMBER_900 = new FloatValue(CSSUnit.CSS_NUMBER, 900); /** * The 'inherit' value. @@ -104,648 +105,642 @@ public interface ValueConstants { /** * The 'all' keyword. */ - Value ALL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ALL_VALUE); + Value ALL_VALUE = new IdentValue(CSSConstants.CSS_ALL_VALUE); /** * The 'auto' keyword. */ - Value AUTO_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_AUTO_VALUE); + Value AUTO_VALUE = new IdentValue(CSSConstants.CSS_AUTO_VALUE); /** * The 'bidi-override' keyword. */ - Value BIDI_OVERRIDE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BIDI_OVERRIDE_VALUE); + Value BIDI_OVERRIDE_VALUE = new IdentValue(CSSConstants.CSS_BIDI_OVERRIDE_VALUE); /** * The 'blink' keyword. */ - Value BLINK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BLINK_VALUE); + Value BLINK_VALUE = new IdentValue(CSSConstants.CSS_BLINK_VALUE); /** * The 'block' keyword. */ - Value BLOCK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BLOCK_VALUE); + Value BLOCK_VALUE = new IdentValue(CSSConstants.CSS_BLOCK_VALUE); /** * The 'bold' keyword. */ - Value BOLD_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BOLD_VALUE); + Value BOLD_VALUE = new IdentValue(CSSConstants.CSS_BOLD_VALUE); /** * The 'bolder' keyword. */ - Value BOLDER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BOLDER_VALUE); + Value BOLDER_VALUE = new IdentValue(CSSConstants.CSS_BOLDER_VALUE); /** * The 'bottom' keyword. */ - Value BOTTOM_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BOTTOM_VALUE); + Value BOTTOM_VALUE = new IdentValue(CSSConstants.CSS_BOTTOM_VALUE); /** * The 'collapse' keyword. */ - Value COLLAPSE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_COLLAPSE_VALUE); + Value COLLAPSE_VALUE = new IdentValue(CSSConstants.CSS_COLLAPSE_VALUE); /** * The 'compact' keyword. */ - Value COMPACT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_COMPACT_VALUE); + Value COMPACT_VALUE = new IdentValue(CSSConstants.CSS_COMPACT_VALUE); /** * The 'condensed' keyword. */ - Value CONDENSED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CONDENSED_VALUE); + Value CONDENSED_VALUE = new IdentValue(CSSConstants.CSS_CONDENSED_VALUE); /** * The 'crispedges' keyword. */ - Value CRISPEDGES_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CRISPEDGES_VALUE); + Value CRISPEDGES_VALUE = new IdentValue(CSSConstants.CSS_CRISPEDGES_VALUE); /** * The 'crosshair' keyword. */ - Value CROSSHAIR_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CROSSHAIR_VALUE); + Value CROSSHAIR_VALUE = new IdentValue(CSSConstants.CSS_CROSSHAIR_VALUE); /** * The 'cursive' keyword. */ - Value CURSIVE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CURSIVE_VALUE); + Value CURSIVE_VALUE = new IdentValue(CSSConstants.CSS_CURSIVE_VALUE); /** * The 'default' keyword. */ - Value DEFAULT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DEFAULT_VALUE); + Value DEFAULT_VALUE = new IdentValue(CSSConstants.CSS_DEFAULT_VALUE); /** * The 'e-resize' keyword. */ - Value E_RESIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_E_RESIZE_VALUE); + Value E_RESIZE_VALUE = new IdentValue(CSSConstants.CSS_E_RESIZE_VALUE); /** * The 'embed' keyword. */ - Value EMBED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_EMBED_VALUE); + Value EMBED_VALUE = new IdentValue(CSSConstants.CSS_EMBED_VALUE); /** * The 'expanded' keyword. */ - Value EXPANDED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_EXPANDED_VALUE); + Value EXPANDED_VALUE = new IdentValue(CSSConstants.CSS_EXPANDED_VALUE); /** * The 'extra-condensed' keyword. */ - Value EXTRA_CONDENSED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_EXTRA_CONDENSED_VALUE); + Value EXTRA_CONDENSED_VALUE = new IdentValue(CSSConstants.CSS_EXTRA_CONDENSED_VALUE); /** * The 'extra-expanded' keyword. */ - Value EXTRA_EXPANDED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_EXTRA_EXPANDED_VALUE); + Value EXTRA_EXPANDED_VALUE = new IdentValue(CSSConstants.CSS_EXTRA_EXPANDED_VALUE); /** * The 'fantasy' keyword. */ - Value FANTASY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_FANTASY_VALUE); + Value FANTASY_VALUE = new IdentValue(CSSConstants.CSS_FANTASY_VALUE); /** * The 'help' keyword. */ - Value HELP_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_HELP_VALUE); + Value HELP_VALUE = new IdentValue(CSSConstants.CSS_HELP_VALUE); /** * The 'hidden' keyword. */ - Value HIDDEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_HIDDEN_VALUE); + Value HIDDEN_VALUE = new IdentValue(CSSConstants.CSS_HIDDEN_VALUE); /** * The 'inline' keyword. */ - Value INLINE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INLINE_VALUE); + Value INLINE_VALUE = new IdentValue(CSSConstants.CSS_INLINE_VALUE); /** * The 'inline-block' keyword. */ - Value INLINE_BLOCK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INLINE_BLOCK_VALUE); + Value INLINE_BLOCK_VALUE = new IdentValue(CSSConstants.CSS_INLINE_BLOCK_VALUE); /** * The 'inline-table' keyword. */ - Value INLINE_TABLE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INLINE_TABLE_VALUE); + Value INLINE_TABLE_VALUE = new IdentValue(CSSConstants.CSS_INLINE_TABLE_VALUE); /** * The 'italic' keyword. */ - Value ITALIC_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ITALIC_VALUE); + Value ITALIC_VALUE = new IdentValue(CSSConstants.CSS_ITALIC_VALUE); /** * The 'large' keyword. */ - Value LARGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LARGE_VALUE); + Value LARGE_VALUE = new IdentValue(CSSConstants.CSS_LARGE_VALUE); /** * The 'larger' keyword. */ - Value LARGER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LARGER_VALUE); + Value LARGER_VALUE = new IdentValue(CSSConstants.CSS_LARGER_VALUE); /** * The 'lighter' keyword. */ - Value LIGHTER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTER_VALUE); + Value LIGHTER_VALUE = new IdentValue(CSSConstants.CSS_LIGHTER_VALUE); /** * The 'line_through' keyword. */ - Value LINE_THROUGH_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LINE_THROUGH_VALUE); + Value LINE_THROUGH_VALUE = new IdentValue(CSSConstants.CSS_LINE_THROUGH_VALUE); /** * The 'list-item' keyword. */ - Value LIST_ITEM_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIST_ITEM_VALUE); + Value LIST_ITEM_VALUE = new IdentValue(CSSConstants.CSS_LIST_ITEM_VALUE); /** * The 'ltr' keyword. */ - Value LTR_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LTR_VALUE); + Value LTR_VALUE = new IdentValue(CSSConstants.CSS_LTR_VALUE); /** * The 'marker' keyword. */ - Value MARKER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MARKER_VALUE); + Value MARKER_VALUE = new IdentValue(CSSConstants.CSS_MARKER_VALUE); /** * The 'medium' keyword. */ - Value MEDIUM_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MEDIUM_VALUE); + Value MEDIUM_VALUE = new IdentValue(CSSConstants.CSS_MEDIUM_VALUE); /** * The 'monospaced' keyword. */ - Value MONOSPACE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MONOSPACE_VALUE); + Value MONOSPACE_VALUE = new IdentValue(CSSConstants.CSS_MONOSPACE_VALUE); /** * The 'move' keyword. */ - Value MOVE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MOVE_VALUE); + Value MOVE_VALUE = new IdentValue(CSSConstants.CSS_MOVE_VALUE); /** * The 'n-resize' keyword. */ - Value N_RESIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_N_RESIZE_VALUE); + Value N_RESIZE_VALUE = new IdentValue(CSSConstants.CSS_N_RESIZE_VALUE); /** * The 'narrower' keyword. */ - Value NARROWER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NARROWER_VALUE); + Value NARROWER_VALUE = new IdentValue(CSSConstants.CSS_NARROWER_VALUE); /** * The 'ne-resize' keyword. */ - Value NE_RESIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NE_RESIZE_VALUE); + Value NE_RESIZE_VALUE = new IdentValue(CSSConstants.CSS_NE_RESIZE_VALUE); /** * The 'nw-resize' keyword. */ - Value NW_RESIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NW_RESIZE_VALUE); + Value NW_RESIZE_VALUE = new IdentValue(CSSConstants.CSS_NW_RESIZE_VALUE); /** * The 'none' keyword. */ - Value NONE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NONE_VALUE); + Value NONE_VALUE = new IdentValue(CSSConstants.CSS_NONE_VALUE); /** * The 'normal' keyword. */ - Value NORMAL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NORMAL_VALUE); + Value NORMAL_VALUE = new IdentValue(CSSConstants.CSS_NORMAL_VALUE); /** * The 'oblique' keyword. */ - Value OBLIQUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_OBLIQUE_VALUE); + Value OBLIQUE_VALUE = new IdentValue(CSSConstants.CSS_OBLIQUE_VALUE); /** * The 'overline' keyword. */ - Value OVERLINE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_OVERLINE_VALUE); + Value OVERLINE_VALUE = new IdentValue(CSSConstants.CSS_OVERLINE_VALUE); /** * The 'pointer' keyword. */ - Value POINTER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_POINTER_VALUE); + Value POINTER_VALUE = new IdentValue(CSSConstants.CSS_POINTER_VALUE); /** * The 'painted' keyword. */ - Value PAINTED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PAINTED_VALUE); + Value PAINTED_VALUE = new IdentValue(CSSConstants.CSS_PAINTED_VALUE); /** * The 'rtl' keyword. */ - Value RTL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_RTL_VALUE); + Value RTL_VALUE = new IdentValue(CSSConstants.CSS_RTL_VALUE); /** * The 'run-in' keyword. */ - Value RUN_IN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_RUN_IN_VALUE); + Value RUN_IN_VALUE = new IdentValue(CSSConstants.CSS_RUN_IN_VALUE); /** * The 's-resize' keyword. */ - Value S_RESIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_S_RESIZE_VALUE); + Value S_RESIZE_VALUE = new IdentValue(CSSConstants.CSS_S_RESIZE_VALUE); /** * The 'sans-serif' keyword. */ - Value SANS_SERIF_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SANS_SERIF_VALUE); + Value SANS_SERIF_VALUE = new IdentValue(CSSConstants.CSS_SANS_SERIF_VALUE); /** * The 'scroll' keyword. */ - Value SCROLL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SCROLL_VALUE); + Value SCROLL_VALUE = new IdentValue(CSSConstants.CSS_SCROLL_VALUE); /** * The 'se-resize' keyword. */ - Value SE_RESIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SE_RESIZE_VALUE); + Value SE_RESIZE_VALUE = new IdentValue(CSSConstants.CSS_SE_RESIZE_VALUE); /** * The 'semi-condensed' keyword. */ - Value SEMI_CONDENSED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SEMI_CONDENSED_VALUE); + Value SEMI_CONDENSED_VALUE = new IdentValue(CSSConstants.CSS_SEMI_CONDENSED_VALUE); /** * The 'semi-expanded' keyword. */ - Value SEMI_EXPANDED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SEMI_EXPANDED_VALUE); + Value SEMI_EXPANDED_VALUE = new IdentValue(CSSConstants.CSS_SEMI_EXPANDED_VALUE); /** * The 'serif' keyword. */ - Value SERIF_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SERIF_VALUE); + Value SERIF_VALUE = new IdentValue(CSSConstants.CSS_SERIF_VALUE); /** * The 'small' keyword. */ - Value SMALL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SMALL_VALUE); + Value SMALL_VALUE = new IdentValue(CSSConstants.CSS_SMALL_VALUE); /** * The 'small-caps' keyword. */ - Value SMALL_CAPS_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SMALL_CAPS_VALUE); + Value SMALL_CAPS_VALUE = new IdentValue(CSSConstants.CSS_SMALL_CAPS_VALUE); /** * The 'smaller' keyword. */ - Value SMALLER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SMALLER_VALUE); + Value SMALLER_VALUE = new IdentValue(CSSConstants.CSS_SMALLER_VALUE); /** * The 'stroke' keyword. */ - Value STROKE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_STROKE_VALUE); + Value STROKE_VALUE = new IdentValue(CSSConstants.CSS_STROKE_VALUE); /** * The 'sw-resize' keyword. */ - Value SW_RESIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SW_RESIZE_VALUE); + Value SW_RESIZE_VALUE = new IdentValue(CSSConstants.CSS_SW_RESIZE_VALUE); /** * The 'table' keyword. */ - Value TABLE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TABLE_VALUE); + Value TABLE_VALUE = new IdentValue(CSSConstants.CSS_TABLE_VALUE); /** * The 'table-caption' keyword. */ - Value TABLE_CAPTION_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TABLE_CAPTION_VALUE); + Value TABLE_CAPTION_VALUE = new IdentValue(CSSConstants.CSS_TABLE_CAPTION_VALUE); /** * The 'table-cell' keyword. */ - Value TABLE_CELL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TABLE_CELL_VALUE); + Value TABLE_CELL_VALUE = new IdentValue(CSSConstants.CSS_TABLE_CELL_VALUE); /** * The 'table-column' keyword. */ - Value TABLE_COLUMN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TABLE_COLUMN_VALUE); + Value TABLE_COLUMN_VALUE = new IdentValue(CSSConstants.CSS_TABLE_COLUMN_VALUE); /** * The 'table-column-group' keyword. */ - Value TABLE_COLUMN_GROUP_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_TABLE_COLUMN_GROUP_VALUE); + Value TABLE_COLUMN_GROUP_VALUE = new IdentValue(CSSConstants.CSS_TABLE_COLUMN_GROUP_VALUE); /** * The 'table-footer-group' keyword. */ - Value TABLE_FOOTER_GROUP_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_TABLE_FOOTER_GROUP_VALUE); + Value TABLE_FOOTER_GROUP_VALUE = new IdentValue(CSSConstants.CSS_TABLE_FOOTER_GROUP_VALUE); /** * The 'table-header-group' keyword. */ - Value TABLE_HEADER_GROUP_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_TABLE_HEADER_GROUP_VALUE); + Value TABLE_HEADER_GROUP_VALUE = new IdentValue(CSSConstants.CSS_TABLE_HEADER_GROUP_VALUE); /** * The 'table-row' keyword. */ - Value TABLE_ROW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TABLE_ROW_VALUE); + Value TABLE_ROW_VALUE = new IdentValue(CSSConstants.CSS_TABLE_ROW_VALUE); /** * The 'table-row-group' keyword. */ - Value TABLE_ROW_GROUP_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TABLE_ROW_GROUP_VALUE); + Value TABLE_ROW_GROUP_VALUE = new IdentValue(CSSConstants.CSS_TABLE_ROW_GROUP_VALUE); /** * The 'text' keyword. */ - Value TEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TEXT_VALUE); + Value TEXT_VALUE = new IdentValue(CSSConstants.CSS_TEXT_VALUE); /** * The 'ultra-condensed' keyword. */ - Value ULTRA_CONDENSED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ULTRA_CONDENSED_VALUE); + Value ULTRA_CONDENSED_VALUE = new IdentValue(CSSConstants.CSS_ULTRA_CONDENSED_VALUE); /** * The 'ultra-expanded' keyword. */ - Value ULTRA_EXPANDED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ULTRA_EXPANDED_VALUE); + Value ULTRA_EXPANDED_VALUE = new IdentValue(CSSConstants.CSS_ULTRA_EXPANDED_VALUE); /** * The 'top' keyword. */ - Value TOP_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TOP_VALUE); + Value TOP_VALUE = new IdentValue(CSSConstants.CSS_TOP_VALUE); /** * The 'underline' keyword. */ - Value UNDERLINE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_UNDERLINE_VALUE); + Value UNDERLINE_VALUE = new IdentValue(CSSConstants.CSS_UNDERLINE_VALUE); /** * The 'visible' keyword. */ - Value VISIBLE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_VISIBLE_VALUE); + Value VISIBLE_VALUE = new IdentValue(CSSConstants.CSS_VISIBLE_VALUE); /** * The 'w-resize' keyword. */ - Value W_RESIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_W_RESIZE_VALUE); + Value W_RESIZE_VALUE = new IdentValue(CSSConstants.CSS_W_RESIZE_VALUE); /** * The 'wait' keyword. */ - Value WAIT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_WAIT_VALUE); + Value WAIT_VALUE = new IdentValue(CSSConstants.CSS_WAIT_VALUE); /** * The 'wider' keyword. */ - Value WIDER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_WIDER_VALUE); + Value WIDER_VALUE = new IdentValue(CSSConstants.CSS_WIDER_VALUE); /** * The 'x-large' keyword. */ - Value X_LARGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_X_LARGE_VALUE); + Value X_LARGE_VALUE = new IdentValue(CSSConstants.CSS_X_LARGE_VALUE); /** * The 'x-small' keyword. */ - Value X_SMALL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_X_SMALL_VALUE); + Value X_SMALL_VALUE = new IdentValue(CSSConstants.CSS_X_SMALL_VALUE); /** * The 'xx-large' keyword. */ - Value XX_LARGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_XX_LARGE_VALUE); + Value XX_LARGE_VALUE = new IdentValue(CSSConstants.CSS_XX_LARGE_VALUE); /** * The 'xx-small' keyword. */ - Value XX_SMALL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_XX_SMALL_VALUE); + Value XX_SMALL_VALUE = new IdentValue(CSSConstants.CSS_XX_SMALL_VALUE); /** * The 'aqua' color name. */ - Value AQUA_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_AQUA_VALUE); + Value AQUA_VALUE = new IdentValue(CSSConstants.CSS_AQUA_VALUE); /** * The 'black' color name. */ - Value BLACK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BLACK_VALUE); + Value BLACK_VALUE = new IdentValue(CSSConstants.CSS_BLACK_VALUE); /** * The 'blue' color name. */ - Value BLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BLUE_VALUE); + Value BLUE_VALUE = new IdentValue(CSSConstants.CSS_BLUE_VALUE); /** * The 'fuchsia' color name. */ - Value FUCHSIA_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_FUCHSIA_VALUE); + Value FUCHSIA_VALUE = new IdentValue(CSSConstants.CSS_FUCHSIA_VALUE); /** * The 'gray' color name. */ - Value GRAY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GRAY_VALUE); + Value GRAY_VALUE = new IdentValue(CSSConstants.CSS_GRAY_VALUE); /** * The 'green' color name. */ - Value GREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GREEN_VALUE); + Value GREEN_VALUE = new IdentValue(CSSConstants.CSS_GREEN_VALUE); /** * The 'lime' color name. */ - Value LIME_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIME_VALUE); + Value LIME_VALUE = new IdentValue(CSSConstants.CSS_LIME_VALUE); /** * The 'maroon' color name. */ - Value MAROON_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MAROON_VALUE); + Value MAROON_VALUE = new IdentValue(CSSConstants.CSS_MAROON_VALUE); /** * The 'navy' color name. */ - Value NAVY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NAVY_VALUE); + Value NAVY_VALUE = new IdentValue(CSSConstants.CSS_NAVY_VALUE); /** * The 'olive' color name. */ - Value OLIVE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_OLIVE_VALUE); + Value OLIVE_VALUE = new IdentValue(CSSConstants.CSS_OLIVE_VALUE); /** * The 'purple' color name. */ - Value PURPLE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PURPLE_VALUE); + Value PURPLE_VALUE = new IdentValue(CSSConstants.CSS_PURPLE_VALUE); /** * The 'red' color name. */ - Value RED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_RED_VALUE); + Value RED_VALUE = new IdentValue(CSSConstants.CSS_RED_VALUE); /** * The 'silver' color name. */ - Value SILVER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SILVER_VALUE); + Value SILVER_VALUE = new IdentValue(CSSConstants.CSS_SILVER_VALUE); /** * The 'teal' color name. */ - Value TEAL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TEAL_VALUE); + Value TEAL_VALUE = new IdentValue(CSSConstants.CSS_TEAL_VALUE); /** * The 'transparent' color name. */ - Value TRANSPARENT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TRANSPARENT_VALUE); + Value TRANSPARENT_VALUE = new IdentValue(CSSConstants.CSS_TRANSPARENT_VALUE); /** * The 'white' color name. */ - Value WHITE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_WHITE_VALUE); + Value WHITE_VALUE = new IdentValue(CSSConstants.CSS_WHITE_VALUE); /** * The 'yellow' color name. */ - Value YELLOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_YELLOW_VALUE); + Value YELLOW_VALUE = new IdentValue(CSSConstants.CSS_YELLOW_VALUE); /** * The 'ACTIVEBORDER' color name. */ - Value ACTIVEBORDER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ACTIVEBORDER_VALUE); + Value ACTIVEBORDER_VALUE = new IdentValue(CSSConstants.CSS_ACTIVEBORDER_VALUE); /** * The 'ACTIVECAPTION' color name. */ - Value ACTIVECAPTION_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ACTIVECAPTION_VALUE); + Value ACTIVECAPTION_VALUE = new IdentValue(CSSConstants.CSS_ACTIVECAPTION_VALUE); /** * The 'APPWORKSPACE' color name. */ - Value APPWORKSPACE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_APPWORKSPACE_VALUE); + Value APPWORKSPACE_VALUE = new IdentValue(CSSConstants.CSS_APPWORKSPACE_VALUE); /** * The 'BACKGROUND' color name. */ - Value BACKGROUND_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BACKGROUND_VALUE); + Value BACKGROUND_VALUE = new IdentValue(CSSConstants.CSS_BACKGROUND_VALUE); /** * The 'BUTTONFACE' color name. */ - Value BUTTONFACE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BUTTONFACE_VALUE); + Value BUTTONFACE_VALUE = new IdentValue(CSSConstants.CSS_BUTTONFACE_VALUE); /** * The 'BUTTONHIGHLIGHT' color name. */ - Value BUTTONHIGHLIGHT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BUTTONHIGHLIGHT_VALUE); + Value BUTTONHIGHLIGHT_VALUE = new IdentValue(CSSConstants.CSS_BUTTONHIGHLIGHT_VALUE); /** * The 'BUTTONSHADOW' color name. */ - Value BUTTONSHADOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BUTTONSHADOW_VALUE); + Value BUTTONSHADOW_VALUE = new IdentValue(CSSConstants.CSS_BUTTONSHADOW_VALUE); /** * The 'BUTTONTEXT' color name. */ - Value BUTTONTEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BUTTONTEXT_VALUE); + Value BUTTONTEXT_VALUE = new IdentValue(CSSConstants.CSS_BUTTONTEXT_VALUE); /** * The 'CAPTIONTEXT' color name. */ - Value CAPTIONTEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CAPTIONTEXT_VALUE); + Value CAPTIONTEXT_VALUE = new IdentValue(CSSConstants.CSS_CAPTIONTEXT_VALUE); /** * The 'GRAYTEXT' color name. */ - Value GRAYTEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GRAYTEXT_VALUE); + Value GRAYTEXT_VALUE = new IdentValue(CSSConstants.CSS_GRAYTEXT_VALUE); /** * The 'HIGHLIGHT' color name. */ - Value HIGHLIGHT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_HIGHLIGHT_VALUE); + Value HIGHLIGHT_VALUE = new IdentValue(CSSConstants.CSS_HIGHLIGHT_VALUE); /** * The 'HIGHLIGHTTEXT' color name. */ - Value HIGHLIGHTTEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_HIGHLIGHTTEXT_VALUE); + Value HIGHLIGHTTEXT_VALUE = new IdentValue(CSSConstants.CSS_HIGHLIGHTTEXT_VALUE); /** * The 'INACTIVEBORDER' color name. */ - Value INACTIVEBORDER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INACTIVEBORDER_VALUE); + Value INACTIVEBORDER_VALUE = new IdentValue(CSSConstants.CSS_INACTIVEBORDER_VALUE); /** * The 'INACTIVECAPTION' color name. */ - Value INACTIVECAPTION_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INACTIVECAPTION_VALUE); + Value INACTIVECAPTION_VALUE = new IdentValue(CSSConstants.CSS_INACTIVECAPTION_VALUE); /** * The 'INACTIVECAPTIONTEXT' color name. */ - Value INACTIVECAPTIONTEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_INACTIVECAPTIONTEXT_VALUE); + Value INACTIVECAPTIONTEXT_VALUE = new IdentValue(CSSConstants.CSS_INACTIVECAPTIONTEXT_VALUE); /** * The 'INFOBACKGROUND' color name. */ - Value INFOBACKGROUND_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INFOBACKGROUND_VALUE); + Value INFOBACKGROUND_VALUE = new IdentValue(CSSConstants.CSS_INFOBACKGROUND_VALUE); /** * The 'INFOTEXT' color name. */ - Value INFOTEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INFOTEXT_VALUE); + Value INFOTEXT_VALUE = new IdentValue(CSSConstants.CSS_INFOTEXT_VALUE); /** * The 'MENU' color name. */ - Value MENU_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MENU_VALUE); + Value MENU_VALUE = new IdentValue(CSSConstants.CSS_MENU_VALUE); /** * The 'MENUTEXT' color name. */ - Value MENUTEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MENUTEXT_VALUE); + Value MENUTEXT_VALUE = new IdentValue(CSSConstants.CSS_MENUTEXT_VALUE); /** * The 'SCROLLBAR' color name. */ - Value SCROLLBAR_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SCROLLBAR_VALUE); + Value SCROLLBAR_VALUE = new IdentValue(CSSConstants.CSS_SCROLLBAR_VALUE); /** * The 'THREEDDARKSHADOW' color name. */ - Value THREEDDARKSHADOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_THREEDDARKSHADOW_VALUE); + Value THREEDDARKSHADOW_VALUE = new IdentValue(CSSConstants.CSS_THREEDDARKSHADOW_VALUE); /** * The 'THREEDFACE' color name. */ - Value THREEDFACE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_THREEDFACE_VALUE); + Value THREEDFACE_VALUE = new IdentValue(CSSConstants.CSS_THREEDFACE_VALUE); /** * The 'THREEDHIGHLIGHT' color name. */ - Value THREEDHIGHLIGHT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_THREEDHIGHLIGHT_VALUE); + Value THREEDHIGHLIGHT_VALUE = new IdentValue(CSSConstants.CSS_THREEDHIGHLIGHT_VALUE); /** * The 'THREEDLIGHTSHADOW' color name. */ - Value THREEDLIGHTSHADOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_THREEDLIGHTSHADOW_VALUE); + Value THREEDLIGHTSHADOW_VALUE = new IdentValue(CSSConstants.CSS_THREEDLIGHTSHADOW_VALUE); /** * The 'THREEDSHADOW' color name. */ - Value THREEDSHADOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_THREEDSHADOW_VALUE); + Value THREEDSHADOW_VALUE = new IdentValue(CSSConstants.CSS_THREEDSHADOW_VALUE); /** * The 'WINDOW' color name. */ - Value WINDOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_WINDOW_VALUE); + Value WINDOW_VALUE = new IdentValue(CSSConstants.CSS_WINDOW_VALUE); /** * The 'WINDOWFRAME' color name. */ - Value WINDOWFRAME_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_WINDOWFRAME_VALUE); + Value WINDOWFRAME_VALUE = new IdentValue(CSSConstants.CSS_WINDOWFRAME_VALUE); /** * The 'WINDOWTEXT' color name. */ - Value WINDOWTEXT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_WINDOWTEXT_VALUE); + Value WINDOWTEXT_VALUE = new IdentValue(CSSConstants.CSS_WINDOWTEXT_VALUE); /** * The 'black' RGB color. diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueManager.java index aabe4ac2a..8fee9a3a8 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueManager.java @@ -22,6 +22,7 @@ import org.w3c.dom.DOMException; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -30,8 +31,10 @@ * This interface is implemented by objects which manage the values associated * with a property. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public interface ValueManager { @@ -87,12 +90,12 @@ public interface ValueManager { /** * Creates and returns a new string value. * - * @param type A string code as defined in CSSPrimitiveValue. The string code - * can only be a string unit type. + * @param type A value type as defined in Value.Type. The string code + * can only be a string-like unit type. * @param value The new string value. * @param engine The CSS engine. */ - Value createStringValue(short type, String value, CSSEngine engine) throws DOMException; + Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException; /** * Computes the given value. diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueModificationHandler.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueModificationHandler.java new file mode 100644 index 000000000..b8fd52bf0 --- /dev/null +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/ValueModificationHandler.java @@ -0,0 +1,31 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.css.engine.value; + +/** + * Manage the modification of values. + */ +public interface ValueModificationHandler { + + /** + * Notify that the value changed. + */ + void valueChanged(Value v); + +} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/ClipManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/ClipManager.java index fbac5d7c3..d40f3c4c2 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/ClipManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/ClipManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.css2; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.InheritValue; import io.sf.carte.echosvg.css.engine.value.RectManager; @@ -34,8 +34,10 @@ /** * This class provides a manager for the 'clip' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class ClipManager extends RectManager { @@ -107,12 +109,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return super.createValue(lu, engine); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } if (!value.equalsIgnoreCase(CSSConstants.CSS_AUTO_VALUE)) { diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/CursorManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/CursorManager.java index 31adc5819..191825ba9 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/CursorManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/CursorManager.java @@ -19,10 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.css2; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -39,8 +38,10 @@ /** * This class provides a manager for the 'cursor' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class CursorManager extends AbstractValueManager { @@ -165,22 +166,18 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return result; } - /** - * Implements - * {@link ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}. - */ @Override public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { - if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) { - ListValue lv = (ListValue) value; - int len = lv.getLength(); + if (value.getCssValueType() == Value.CssType.LIST) { + int len = value.getLength(); ListValue result = new ListValue(' '); for (int i = 0; i < len; i++) { - Value v = lv.item(0); - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_URI) { - // Reveal the absolute value as the cssText now. - result.append(new URIValue(v.getStringValue(), v.getStringValue())); + Value v = value.item(0); + if (v.getPrimitiveType() == Type.URI) { + // For performance, use the absolute value as the cssText now. + String uri = v.getURIValue(); + result.append(new URIValue(uri, uri)); } else { result.append(v); } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontFamilyManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontFamilyManager.java index 05f8bf701..d9e41b6ca 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontFamilyManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontFamilyManager.java @@ -19,7 +19,6 @@ package io.sf.carte.echosvg.css.engine.value.css2; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.doc.style.css.nsac.LexicalUnit.LexicalType; @@ -28,6 +27,7 @@ import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; +import io.sf.carte.echosvg.css.engine.value.IdentValue; import io.sf.carte.echosvg.css.engine.value.ListValue; import io.sf.carte.echosvg.css.engine.value.StringMap; import io.sf.carte.echosvg.css.engine.value.StringValue; @@ -40,8 +40,10 @@ /** * This class provides a factory for the 'font-family' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class FontFamilyManager extends AbstractValueManager { @@ -51,9 +53,9 @@ public class FontFamilyManager extends AbstractValueManager { */ protected static final ListValue DEFAULT_VALUE = new ListValue(); static { - DEFAULT_VALUE.append(new StringValue(CSSPrimitiveValue.CSS_STRING, "Arial")); - DEFAULT_VALUE.append(new StringValue(CSSPrimitiveValue.CSS_STRING, "Helvetica")); - DEFAULT_VALUE.append(new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SANS_SERIF_VALUE)); + DEFAULT_VALUE.append(new StringValue("Arial")); + DEFAULT_VALUE.append(new StringValue("Helvetica")); + DEFAULT_VALUE.append(new IdentValue(CSSConstants.CSS_SANS_SERIF_VALUE)); } /** @@ -135,7 +137,7 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { for (;;) { switch (lu.getLexicalUnitType()) { case STRING: - result.append(new StringValue(CSSPrimitiveValue.CSS_STRING, lu.getStringValue())); + result.append(new StringValue(lu.getStringValue())); lu = lu.getNextLexicalUnit(); break; @@ -158,12 +160,12 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { } lu = lu.getNextLexicalUnit(); } while (lu != null && isIdentOrNumber(lu)); - result.append(new StringValue(CSSPrimitiveValue.CSS_STRING, sb.toString())); + result.append(new StringValue(sb.toString())); } else { String id = sb.toString(); String s = id.toLowerCase().intern(); Value v = (Value) values.get(s); - result.append((v != null) ? v : new StringValue(CSSPrimitiveValue.CSS_STRING, id)); + result.append((v != null) ? v : new StringValue(id)); } break; default: diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontShorthandManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontShorthandManager.java index 5094a239b..3a2de0a5f 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontShorthandManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontShorthandManager.java @@ -24,7 +24,8 @@ import java.util.HashSet; import java.util.Set; -import io.sf.carte.doc.style.css.CSSUnit; +import org.w3c.css.om.unit.CSSUnit; + import io.sf.carte.doc.style.css.nsac.CSSParseException; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.doc.style.css.parser.CSSParser; @@ -49,8 +50,10 @@ * considering the 'last' number before an 'ident' or '/' to be font-size and * any preceeding number to be font-weight. * - * @author deweese - * @author For later modifications, see Git history. + *

+ * Original author: deweese. + * For later modifications, see Git history. + *

* @version $Id$ */ public class FontShorthandManager extends AbstractValueFactory implements ShorthandManager { diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontSizeAdjustManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontSizeAdjustManager.java index f537b68a6..a48ed888b 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontSizeAdjustManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontSizeAdjustManager.java @@ -18,10 +18,11 @@ */ package io.sf.carte.echosvg.css.engine.value.css2; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; import io.sf.carte.echosvg.css.engine.value.FloatValue; @@ -34,8 +35,10 @@ /** * This class provides a manager for the 'font-size-adjust' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class FontSizeAdjustManager extends AbstractValueManager { @@ -98,10 +101,10 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return ValueConstants.INHERIT_VALUE; case INTEGER: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getIntegerValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getIntegerValue()); case REAL: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getFloatValue()); case IDENT: if (lu.getStringValue().equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { @@ -115,12 +118,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } if (value.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { @@ -134,7 +134,7 @@ public Value createStringValue(short type, String value, CSSEngine engine) throw */ @Override public Value createFloatValue(short type, float floatValue) throws DOMException { - if (type == CSSPrimitiveValue.CSS_NUMBER) { + if (type == CSSUnit.CSS_NUMBER) { return new FloatValue(type, floatValue); } throw createInvalidFloatTypeDOMException(type); diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontSizeManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontSizeManager.java index 33794635b..38ac4d232 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontSizeManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontSizeManager.java @@ -18,10 +18,12 @@ */ package io.sf.carte.echosvg.css.engine.value.css2; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.Viewport; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSContext; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; @@ -39,8 +41,10 @@ /** * This class provides a manager for the 'font-size' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class FontSizeManager extends LengthManager { @@ -139,12 +143,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return super.createValue(lu, engine); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } Object v = values.get(value.toLowerCase().intern()); @@ -164,48 +165,76 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin float scale = 1.0f; boolean doParentRelative = false; - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_NUMBER: - case CSSPrimitiveValue.CSS_PX: + switch (value.getCSSUnit()) { + case CSSUnit.CSS_NUMBER: + case CSSUnit.CSS_PX: return value; - case CSSPrimitiveValue.CSS_MM: + case CSSUnit.CSS_MM: CSSContext ctx = engine.getCSSContext(); - float v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v / ctx.getPixelUnitToMillimeter()); + float v = lengthValue(value); + return new FloatValue(CSSUnit.CSS_NUMBER, v / ctx.getPixelUnitToMillimeter()); - case CSSPrimitiveValue.CSS_CM: + case CSSUnit.CSS_CM: ctx = engine.getCSSContext(); - v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * 10f / ctx.getPixelUnitToMillimeter()); + v = lengthValue(value); + return new FloatValue(CSSUnit.CSS_NUMBER, v * 10f / ctx.getPixelUnitToMillimeter()); - case CSSPrimitiveValue.CSS_IN: + case CSSUnit.CSS_IN: ctx = engine.getCSSContext(); - v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * 25.4f / ctx.getPixelUnitToMillimeter()); + v = lengthValue(value); + return new FloatValue(CSSUnit.CSS_NUMBER, v * 25.4f / ctx.getPixelUnitToMillimeter()); - case CSSPrimitiveValue.CSS_PT: + case CSSUnit.CSS_PT: ctx = engine.getCSSContext(); - v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * 25.4f / (72f * ctx.getPixelUnitToMillimeter())); + v = lengthValue(value); + return new FloatValue(CSSUnit.CSS_NUMBER, v * 25.4f / (72f * ctx.getPixelUnitToMillimeter())); - case CSSPrimitiveValue.CSS_PC: + case CSSUnit.CSS_PC: ctx = engine.getCSSContext(); - v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, (v * 25.4f / (6f * ctx.getPixelUnitToMillimeter()))); + v = lengthValue(value); + return new FloatValue(CSSUnit.CSS_NUMBER, (v * 25.4f / (6f * ctx.getPixelUnitToMillimeter()))); - case CSSPrimitiveValue.CSS_EMS: + case CSSUnit.CSS_EM: doParentRelative = true; - scale = value.getFloatValue(); + scale = lengthValue(value); break; - case CSSPrimitiveValue.CSS_EXS: + case CSSUnit.CSS_EX: doParentRelative = true; - scale = value.getFloatValue() * 0.5f; // !!! x-height + scale = lengthValue(value) * 0.5f; // !!! x-height break; - case CSSPrimitiveValue.CSS_PERCENTAGE: + case CSSUnit.CSS_PERCENTAGE: doParentRelative = true; scale = value.getFloatValue() * 0.01f; break; + case CSSUnit.CSS_REM: + scale = lengthValue(value); + return rootRelative(elt, engine, idx, scale); + case CSSUnit.CSS_REX: + scale = lengthValue(value) * 0.5f; + return rootRelative(elt, engine, idx, scale); + case CSSUnit.CSS_VW: + v = lengthValue(value); + return new FloatValue(CSSUnit.CSS_NUMBER, v * + engine.getCSSContext().getViewport(elt).getWidth() * 0.01f); + case CSSUnit.CSS_VH: + v = lengthValue(value); + return new FloatValue(CSSUnit.CSS_NUMBER, v * + engine.getCSSContext().getViewport(elt).getHeight() * 0.01f); + case CSSUnit.CSS_VMIN: + v = lengthValue(value); + Viewport vp = engine.getCSSContext().getViewport(elt); + float w = vp.getWidth(); + float h = vp.getHeight(); + float min = Math.min(w, h); + return new FloatValue(CSSUnit.CSS_NUMBER, v * min * 0.01f); + case CSSUnit.CSS_VMAX: + v = lengthValue(value); + vp = engine.getCSSContext().getViewport(elt); + w = vp.getWidth(); + h = vp.getHeight(); + float max = Math.max(w, h); + return new FloatValue(CSSUnit.CSS_NUMBER, v * max * 0.01f); default: } @@ -227,15 +256,17 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin CSSContext ctx = engine.getCSSContext(); fs = ctx.getMediumFontSize(); } else { - fs = engine.getComputedStyle(p, null, idx).getFloatValue(); + Value cs = engine.getComputedStyle(p, null, idx); + fs = lengthValue(cs); } - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, fs * scale); + return new FloatValue(CSSUnit.CSS_NUMBER, fs * scale); } // absolute identifiers CSSContext ctx = engine.getCSSContext(); float fs = ctx.getMediumFontSize(); - String s = value.getStringValue(); + + String s = value.getIdentifierValue(); switch (s.charAt(0)) { case 'm': break; @@ -272,7 +303,20 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin } } } - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, fs); + return new FloatValue(CSSUnit.CSS_NUMBER, fs); + } + + private Value rootRelative(CSSStylableElement elt, CSSEngine engine, int idx, float scale) { + CSSStylableElement root = (CSSStylableElement) elt.getOwnerDocument().getDocumentElement(); + if (elt == root) { + CSSContext ctx = engine.getCSSContext(); + float f = ctx.getMediumFontSize() * scale; + return new FloatValue(CSSUnit.CSS_NUMBER, f); + } + + Value cs = engine.getComputedStyle(root, null, idx); + float f = lengthValue(cs) * scale; + return new FloatValue(CSSUnit.CSS_NUMBER, f); } /** diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontWeightManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontWeightManager.java index f158907d3..80f334dfa 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontWeightManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/FontWeightManager.java @@ -18,8 +18,8 @@ */ package io.sf.carte.echosvg.css.engine.value.css2; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.echosvg.css.engine.CSSContext; @@ -37,8 +37,10 @@ /** * This class provides a manager for the 'font-weight' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class FontWeightManager extends IdentifierManager { @@ -140,7 +142,7 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { */ @Override public Value createFloatValue(short type, float floatValue) throws DOMException { - if (type == CSSPrimitiveValue.CSS_NUMBER) { + if (type == CSSUnit.CSS_NUMBER) { int i = (int) floatValue; if (floatValue == i) { switch (i) { @@ -185,7 +187,7 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin fw = 400; } else { Value v = engine.getComputedStyle(p, pseudo, idx); - fw = v.getFloatValue(); + fw = lengthValue(v); } return createFontWeight(ctx.getBolderFontWeight(fw)); } else if (value == ValueConstants.LIGHTER_VALUE) { @@ -198,7 +200,7 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin fw = 400; } else { Value v = engine.getComputedStyle(p, pseudo, idx); - fw = v.getFloatValue(); + fw = lengthValue(v); } return createFontWeight(ctx.getLighterFontWeight(fw)); } else if (value == ValueConstants.NORMAL_VALUE) { diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/SrcManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/SrcManager.java index c7426976c..23b188ccc 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/SrcManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/SrcManager.java @@ -18,8 +18,9 @@ */ package io.sf.carte.echosvg.css.engine.value.css2; +import java.util.Locale; + import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.echosvg.css.engine.CSSEngine; @@ -38,9 +39,10 @@ * One line Class Desc * * Complete Class Desc - * - * @author l449433 - * @author For later modifications, see Git history. + *

+ * Original author: l449433. + * For later modifications, see Git history. + *

* @version $Id$ */ public class SrcManager extends IdentifierManager { @@ -129,7 +131,7 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { for (;;) { switch (lu.getLexicalUnitType()) { case STRING: - result.append(new StringValue(CSSPrimitiveValue.CSS_STRING, lu.getStringValue())); + result.append(new StringValue(lu.getStringValue())); lu = lu.getNextLexicalUnit(); break; @@ -159,12 +161,12 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { sb.append(lu.getStringValue()); lu = lu.getNextLexicalUnit(); } while (lu != null && lu.getLexicalUnitType() == LexicalUnit.LexicalType.IDENT); - result.append(new StringValue(CSSPrimitiveValue.CSS_STRING, sb.toString())); + result.append(new StringValue(sb.toString())); } else { String id = sb.toString(); - String s = id.toLowerCase().intern(); + String s = id.toLowerCase(Locale.ROOT).intern(); Value v = (Value) values.get(s); - result.append((v != null) ? v : new StringValue(CSSPrimitiveValue.CSS_STRING, id)); + result.append((v != null) ? v : new StringValue(id)); } break; diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/TextDecorationManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/TextDecorationManager.java index 2fd62c2df..b2b8fc9e5 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/TextDecorationManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/css2/TextDecorationManager.java @@ -18,10 +18,12 @@ */ package io.sf.carte.echosvg.css.engine.value.css2; +import java.util.Locale; + import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; import io.sf.carte.echosvg.css.engine.value.ListValue; @@ -35,8 +37,10 @@ /** * This class provides a manager for the 'text-decoration' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class TextDecorationManager extends AbstractValueManager { @@ -116,7 +120,7 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { ListValue lv = new ListValue(' '); do { if (lu.getLexicalUnitType() == LexicalUnit.LexicalType.IDENT) { - String s = lu.getStringValue().toLowerCase().intern(); + String s = lu.getStringValue().toLowerCase(Locale.ROOT).intern(); Object obj = values.get(s); if (obj == null) { throw createInvalidIdentifierDOMException(lu.getStringValue()); @@ -136,12 +140,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } if (!value.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/BaselineShiftManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/BaselineShiftManager.java index 94bdbaba5..7eb0a9d1a 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/BaselineShiftManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/BaselineShiftManager.java @@ -18,10 +18,11 @@ */ package io.sf.carte.echosvg.css.engine.value.svg; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -37,8 +38,10 @@ /** * This class provides a manager for the 'baseline-shift' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class BaselineShiftManager extends LengthManager { @@ -122,13 +125,10 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return super.createValue(lu, engine); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { - throw createInvalidIdentifierDOMException(value); + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { + throw createInvalidStringTypeDOMException(type); } Object v = values.get(value.toLowerCase().intern()); if (v == null) { @@ -144,7 +144,7 @@ public Value createStringValue(short type, String value, CSSEngine engine) throw @Override public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { - if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_PERCENTAGE) { + if (value.getCSSUnit() == CSSUnit.CSS_PERCENTAGE) { sm.putLineHeightRelative(idx, true); int fsi = engine.getLineHeightIndex(); @@ -157,9 +157,9 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin parent = elt; } Value fs = engine.getComputedStyle(parent, pseudo, fsi); - float fsv = fs.getFloatValue(); + float fsv = lengthValue(fs); float v = value.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, (fsv * v) / 100f); + return new FloatValue(CSSUnit.CSS_NUMBER, (fsv * v) / 100f); } return super.computeValue(elt, pseudo, engine, idx, sm, value); } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ClipPathManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ClipPathManager.java index 2d212656a..a191545c8 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ClipPathManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ClipPathManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; import io.sf.carte.echosvg.css.engine.value.URIValue; @@ -34,8 +34,10 @@ /** * This class provides a manager for the 'clip-path' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class ClipPathManager extends AbstractValueManager { @@ -110,20 +112,19 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { switch (type) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: if (value.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { return ValueConstants.NONE_VALUE; } break; - case CSSPrimitiveValue.CSS_URI: + case URI: return new URIValue(value, resolveURI(engine.getCSSBaseURI(), value)); + default: + break; } throw createInvalidStringTypeDOMException(type); } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ColorProfileManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ColorProfileManager.java index 3110d72c9..dd948bafd 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ColorProfileManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ColorProfileManager.java @@ -19,12 +19,12 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; -import io.sf.carte.echosvg.css.engine.value.StringValue; +import io.sf.carte.echosvg.css.engine.value.IdentValue; import io.sf.carte.echosvg.css.engine.value.URIValue; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.ValueConstants; @@ -35,8 +35,10 @@ /** * This class provides a manager for the 'color-interpolation' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class ColorProfileManager extends AbstractValueManager { @@ -106,7 +108,7 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { if (s.equals(CSSConstants.CSS_SRGB_VALUE)) { return SVGValueConstants.SRGB_VALUE; } - return new StringValue(CSSPrimitiveValue.CSS_IDENT, s); + return new IdentValue(s); case URI: return new URIValue(lu.getStringValue(), resolveURI(engine.getCSSBaseURI(), lu.getStringValue())); @@ -116,13 +118,10 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { switch (type) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: String s = value.toLowerCase(); if (s.equals(CSSConstants.CSS_AUTO_VALUE)) { return ValueConstants.AUTO_VALUE; @@ -130,10 +129,12 @@ public Value createStringValue(short type, String value, CSSEngine engine) throw if (s.equals(CSSConstants.CSS_SRGB_VALUE)) { return SVGValueConstants.SRGB_VALUE; } - return new StringValue(CSSPrimitiveValue.CSS_IDENT, s); + return new IdentValue(s); - case CSSPrimitiveValue.CSS_URI: + case URI: return new URIValue(value, resolveURI(engine.getCSSBaseURI(), value)); + default: + break; } throw createInvalidStringTypeDOMException(type); } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/EnableBackgroundManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/EnableBackgroundManager.java index 6c9ff6d62..1d12e6a47 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/EnableBackgroundManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/EnableBackgroundManager.java @@ -19,10 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -37,8 +36,10 @@ /** * This class provides a manager for the 'enable-background' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class EnableBackgroundManager extends LengthManager { @@ -134,12 +135,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { } } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } if (!value.equalsIgnoreCase(CSSConstants.CSS_ACCUMULATE_VALUE)) { @@ -156,32 +154,27 @@ public Value createFloatValue(short unitType, float floatValue) throws DOMExcept throw createDOMException(); } - /** - * Implements - * {@link ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}. - */ @Override public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { - if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) { - ListValue lv = (ListValue) value; - if (lv.getLength() == 5) { - Value lv1 = lv.item(1); + if (value.getCssValueType() == Value.CssType.LIST) { + if (value.getLength() == 5) { + Value lv1 = value.item(1); orientation = HORIZONTAL_ORIENTATION; Value v1 = super.computeValue(elt, pseudo, engine, idx, sm, lv1); - Value lv2 = lv.item(2); + Value lv2 = value.item(2); orientation = VERTICAL_ORIENTATION; Value v2 = super.computeValue(elt, pseudo, engine, idx, sm, lv2); - Value lv3 = lv.item(3); + Value lv3 = value.item(3); orientation = HORIZONTAL_ORIENTATION; Value v3 = super.computeValue(elt, pseudo, engine, idx, sm, lv3); - Value lv4 = lv.item(4); + Value lv4 = value.item(4); orientation = VERTICAL_ORIENTATION; Value v4 = super.computeValue(elt, pseudo, engine, idx, sm, lv4); if (lv1 != v1 || lv2 != v2 || lv3 != v3 || lv4 != v4) { ListValue result = new ListValue(' '); - result.append(lv.item(0)); + result.append(value.item(0)); result.append(v1); result.append(v2); result.append(v3); diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/FilterManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/FilterManager.java index c9748c2a7..97557d101 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/FilterManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/FilterManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; import io.sf.carte.echosvg.css.engine.value.URIValue; @@ -34,8 +34,10 @@ /** * This class provides a factory for the 'filter' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class FilterManager extends AbstractValueManager { @@ -112,18 +114,15 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type == CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type == Type.IDENT) { if (value.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { return ValueConstants.NONE_VALUE; } throw createInvalidIdentifierDOMException(value); } - if (type == CSSPrimitiveValue.CSS_URI) { + if (type == Type.URI) { return new URIValue(value, resolveURI(engine.getCSSBaseURI(), value)); } throw createInvalidStringTypeDOMException(type); diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/GlyphOrientationManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/GlyphOrientationManager.java index dfdd7ad43..efaa647a9 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/GlyphOrientationManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/GlyphOrientationManager.java @@ -18,10 +18,9 @@ */ package io.sf.carte.echosvg.css.engine.value.svg; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import io.sf.carte.doc.style.css.CSSUnit; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; @@ -34,8 +33,10 @@ /** * This class provides a manager for the 'glyph-orientation' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public abstract class GlyphOrientationManager extends AbstractValueManager { @@ -85,23 +86,23 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { case DIMENSION: switch (lu.getCssUnit()) { case CSSUnit.CSS_DEG: - return new FloatValue(CSSPrimitiveValue.CSS_DEG, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_DEG, lu.getFloatValue()); case CSSUnit.CSS_RAD: - return new FloatValue(CSSPrimitiveValue.CSS_RAD, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_RAD, lu.getFloatValue()); case CSSUnit.CSS_GRAD: - return new FloatValue(CSSPrimitiveValue.CSS_GRAD, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_GRAD, lu.getFloatValue()); case CSSUnit.CSS_TURN: - return new FloatValue(CSSPrimitiveValue.CSS_DEG, lu.getFloatValue() * 360f); + return new FloatValue(CSSUnit.CSS_DEG, lu.getFloatValue() * 360f); } // For SVG angle properties unit defaults to 'deg'. case INTEGER: { int n = lu.getIntegerValue(); - return new FloatValue(CSSPrimitiveValue.CSS_DEG, n); + return new FloatValue(CSSUnit.CSS_DEG, n); } case REAL: { float n = lu.getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_DEG, n); + return new FloatValue(CSSUnit.CSS_DEG, n); } default: break; @@ -116,9 +117,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { @Override public Value createFloatValue(short type, float floatValue) throws DOMException { switch (type) { - case CSSPrimitiveValue.CSS_DEG: - case CSSPrimitiveValue.CSS_GRAD: - case CSSPrimitiveValue.CSS_RAD: + case CSSUnit.CSS_DEG: + case CSSUnit.CSS_GRAD: + case CSSUnit.CSS_RAD: return new FloatValue(type, floatValue); } throw createInvalidFloatValueDOMException(floatValue); diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/GlyphOrientationVerticalManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/GlyphOrientationVerticalManager.java index 36cf91f04..f0513416a 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/GlyphOrientationVerticalManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/GlyphOrientationVerticalManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.ValueConstants; @@ -32,8 +32,10 @@ * This class provides a manager for the 'glyph-orientation-vertical' property * values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class GlyphOrientationVerticalManager extends GlyphOrientationManager { @@ -68,12 +70,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return super.createValue(lu, engine); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } if (value.equalsIgnoreCase(CSSConstants.CSS_AUTO_VALUE)) { diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ICCColor.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ICCColor.java index 985786c39..99e224670 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ICCColor.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/ICCColor.java @@ -19,7 +19,6 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSValue; import io.sf.carte.echosvg.css.engine.value.AbstractValue; @@ -56,15 +55,6 @@ public ICCColor(String name) { colorProfile = name; } - /** - * Implements - * {@link io.sf.carte.echosvg.css.engine.value.Value#getCssValueType()}. - */ - @Override - public short getCssValueType() { - return CSSValue.CSS_CUSTOM; - } - /** * Returns the color name. */ @@ -120,4 +110,17 @@ public String toString() { return getCssText(); } + @Override + public Type getPrimitiveType() { + return Type.COLOR; + } + + @Override + public ICCColor clone() { + ICCColor icc = new ICCColor(colorProfile); + icc.colors = colors.clone(); + icc.count = count; + return icc; + } + } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/KerningManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/KerningManager.java index 3b939950c..74dd4d9a9 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/KerningManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/KerningManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.LengthManager; import io.sf.carte.echosvg.css.engine.value.Value; @@ -33,8 +33,10 @@ /** * This class provides a manager for the 'kerning' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class KerningManager extends LengthManager { @@ -107,12 +109,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return super.createValue(lu, engine); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } if (value.equalsIgnoreCase(CSSConstants.CSS_AUTO_VALUE)) { diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/MarkerManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/MarkerManager.java index 4a75f5d93..b1e3b6b14 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/MarkerManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/MarkerManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; import io.sf.carte.echosvg.css.engine.value.URIValue; @@ -34,8 +34,10 @@ /** * This class provides a manager for the 'marker-*' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class MarkerManager extends AbstractValueManager { @@ -123,22 +125,20 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { switch (type) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: if (value.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { return ValueConstants.NONE_VALUE; } - break; + throw createInvalidIdentifierDOMException(value); - case CSSPrimitiveValue.CSS_URI: + case URI: return new URIValue(value, resolveURI(engine.getCSSBaseURI(), value)); + default: + throw createInvalidStringTypeDOMException(type); } - throw createInvalidStringTypeDOMException(type); } } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/MaskManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/MaskManager.java index aefd3ec02..7181b4807 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/MaskManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/MaskManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.AbstractValueManager; import io.sf.carte.echosvg.css.engine.value.URIValue; @@ -34,8 +34,10 @@ /** * This class provides a manager for the 'mask' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class MaskManager extends AbstractValueManager { @@ -111,20 +113,19 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { switch (type) { - case CSSPrimitiveValue.CSS_IDENT: + case IDENT: if (value.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { return ValueConstants.NONE_VALUE; } break; - case CSSPrimitiveValue.CSS_URI: + case URI: return new URIValue(value, resolveURI(engine.getCSSBaseURI(), value)); + default: + break; } throw createInvalidStringTypeDOMException(type); } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/OpacityManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/OpacityManager.java index 8415290a4..da37217b3 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/OpacityManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/OpacityManager.java @@ -18,8 +18,8 @@ */ package io.sf.carte.echosvg.css.engine.value.svg; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.echosvg.css.engine.CSSEngine; @@ -33,8 +33,10 @@ /** * This class provides a manager for the '*-opacity' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class OpacityManager extends AbstractValueManager { @@ -115,10 +117,10 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return ValueConstants.INHERIT_VALUE; case INTEGER: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getIntegerValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getIntegerValue()); case REAL: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getFloatValue()); default: break; @@ -131,7 +133,7 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { */ @Override public Value createFloatValue(short type, float floatValue) throws DOMException { - if (type == CSSPrimitiveValue.CSS_NUMBER) { + if (type == CSSUnit.CSS_NUMBER) { return new FloatValue(type, floatValue); } throw createInvalidFloatTypeDOMException(type); diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGColorManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGColorManager.java index 946ae6ee7..489a3d7c6 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGColorManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGColorManager.java @@ -19,7 +19,6 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.echosvg.css.engine.CSSEngine; @@ -29,18 +28,16 @@ import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.ValueConstants; import io.sf.carte.echosvg.css.engine.value.ValueManager; -import io.sf.carte.echosvg.css.engine.value.svg12.CIELCHColor; -import io.sf.carte.echosvg.css.engine.value.svg12.CIELabColor; -import io.sf.carte.echosvg.css.engine.value.svg12.DeviceColor; -import io.sf.carte.echosvg.css.engine.value.svg12.ICCNamedColor; import io.sf.carte.echosvg.util.CSSConstants; import io.sf.carte.echosvg.util.SVGTypes; /** * This class provides a manager for the SVGColor property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class SVGColorManager extends ColorManager { @@ -161,6 +158,9 @@ private Value parseColorFunction(LexicalUnit lu, Value v) { } private Value parseColor12Function(LexicalUnit lu, Value v) { + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Deprecated color."); + /* + * @formatter: off String functionName = lu.getFunctionName(); if (functionName.equalsIgnoreCase(ICCNamedColor.ICC_NAMED_COLOR_FUNCTION)) { return createICCNamedColorValue(lu, v); @@ -178,6 +178,8 @@ private Value parseColor12Function(LexicalUnit lu, Value v) { return createDeviceColorValue(lu, v, 0); } return null; + * @formatter: on + */ } private Value createICCColorValue(LexicalUnit lu, Value v) { @@ -196,81 +198,6 @@ private Value createICCColorValue(LexicalUnit lu, Value v) { return icc; } - private Value createICCNamedColorValue(LexicalUnit lu, Value v) { - lu = lu.getParameters(); - expectIdent(lu); - String profileName = lu.getStringValue(); - - lu = lu.getNextLexicalUnit(); - expectComma(lu); - lu = lu.getNextLexicalUnit(); - expectIdent(lu); - String colorName = lu.getStringValue(); - - ICCNamedColor icc = new ICCNamedColor(profileName, colorName); - - lu = lu.getNextLexicalUnit(); - return icc; - } - - private Value createCIELabColorValue(LexicalUnit lu, Value v) { - lu = lu.getParameters(); - float l = getColorValue(lu); - lu = lu.getNextLexicalUnit(); - expectComma(lu); - lu = lu.getNextLexicalUnit(); - float a = getColorValue(lu); - lu = lu.getNextLexicalUnit(); - expectComma(lu); - lu = lu.getNextLexicalUnit(); - float b = getColorValue(lu); - - CIELabColor icc = new CIELabColor(l, a, b); - - lu = lu.getNextLexicalUnit(); - return icc; - } - - private Value createCIELCHColorValue(LexicalUnit lu, Value v) { - lu = lu.getParameters(); - float l = getColorValue(lu); - lu = lu.getNextLexicalUnit(); - expectComma(lu); - lu = lu.getNextLexicalUnit(); - float c = getColorValue(lu); - lu = lu.getNextLexicalUnit(); - expectComma(lu); - lu = lu.getNextLexicalUnit(); - float h = getColorValue(lu); - - CIELCHColor icc = new CIELCHColor(l, c, h); - - lu = lu.getNextLexicalUnit(); - return icc; - } - - private Value createDeviceColorValue(LexicalUnit lu, Value v, int expectedComponents) { - lu = lu.getParameters(); - - boolean nChannel = (expectedComponents <= 0); - DeviceColor col = new DeviceColor(nChannel); - - col.append(getColorValue(lu)); - LexicalUnit lastUnit = lu; - lu = lu.getNextLexicalUnit(); - while (lu != null) { - expectComma(lu); - lu = lu.getNextLexicalUnit(); - col.append(getColorValue(lu)); - lastUnit = lu; - lu = lu.getNextLexicalUnit(); - } - if (!nChannel && expectedComponents != col.getNumberOfColors()) { - throw createInvalidLexicalUnitDOMException(lastUnit.getLexicalUnitType()); - } - return col; - } - private void expectIdent(LexicalUnit lu) { if (lu.getLexicalUnitType() != LexicalUnit.LexicalType.IDENT) { throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); @@ -302,14 +229,13 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin int ci = engine.getColorIndex(); return engine.getComputedStyle(elt, pseudo, ci); } - if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) { - ListValue lv = (ListValue) value; - Value v = lv.item(0); + if (value.getCssValueType() == Value.CssType.LIST) { + Value v = value.item(0); Value t = super.computeValue(elt, pseudo, engine, idx, sm, v); if (t != v) { ListValue result = new ListValue(' '); result.append(t); - result.append(lv.item(1)); + result.append(value.item(1)); return result; } return value; diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGPaintManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGPaintManager.java index 83412670f..383d3b24b 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGPaintManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGPaintManager.java @@ -19,8 +19,6 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.echosvg.css.engine.CSSEngine; @@ -37,8 +35,10 @@ /** * This class provides a manager for the SVGPaint property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class SVGPaintManager extends SVGColorManager { @@ -124,10 +124,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { } } Value v = super.createValue(lu, engine); - if (v.getCssValueType() == CSSValue.CSS_CUSTOM) { - ListValue lv = (ListValue) v; - for (int i = 0; i < lv.getLength(); i++) { - result.append(lv.item(i)); + if (v instanceof ListValue) { + for (int i = 0; i < v.getLength(); i++) { + result.append(v.item(i)); } } else { result.append(v); @@ -145,21 +144,20 @@ public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engin if (value == ValueConstants.NONE_VALUE) { return value; } - if (value.getCssValueType() == CSSValue.CSS_VALUE_LIST) { - ListValue lv = (ListValue) value; - Value v = lv.item(0); - if (v.getPrimitiveType() == CSSPrimitiveValue.CSS_URI) { - v = lv.item(1); + if (value.getCssValueType() == Value.CssType.LIST) { + Value v = value.item(0); + if (v.getPrimitiveType() == Value.Type.URI) { + v = value.item(1); if (v == ValueConstants.NONE_VALUE) { return value; } Value t = super.computeValue(elt, pseudo, engine, idx, sm, v); if (t != v) { ListValue result = new ListValue(' '); - result.append(lv.item(0)); + result.append(value.item(0)); result.append(t); - if (lv.getLength() == 3) { - result.append(lv.item(1)); + if (value.getLength() == 3) { + result.append(value.item(1)); } return result; } diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGValueConstants.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGValueConstants.java index 78b7b3ec4..84d6c3870 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGValueConstants.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SVGValueConstants.java @@ -18,11 +18,12 @@ */ package io.sf.carte.echosvg.css.engine.value.svg; -import org.w3c.dom.css.CSSPrimitiveValue; +import org.w3c.css.om.unit.CSSUnit; import io.sf.carte.echosvg.css.engine.value.FloatValue; +import io.sf.carte.echosvg.css.engine.value.IdentValue; +import io.sf.carte.echosvg.css.engine.value.NumericValue; import io.sf.carte.echosvg.css.engine.value.RGBColorValue; -import io.sf.carte.echosvg.css.engine.value.StringValue; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.ValueConstants; import io.sf.carte.echosvg.util.CSSConstants; @@ -30,8 +31,10 @@ /** * This interface provides constants for SVG values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public interface SVGValueConstants extends ValueConstants { @@ -39,1564 +42,1557 @@ public interface SVGValueConstants extends ValueConstants { /** * 0 degree */ - Value ZERO_DEGREE = new FloatValue(CSSPrimitiveValue.CSS_DEG, 0); + NumericValue ZERO_DEGREE = new FloatValue(CSSUnit.CSS_DEG, 0); /** * 1 */ - Value NUMBER_1 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 1); + NumericValue NUMBER_1 = new FloatValue(CSSUnit.CSS_NUMBER, 1); /** * 4 */ - Value NUMBER_4 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 4); + NumericValue NUMBER_4 = new FloatValue(CSSUnit.CSS_NUMBER, 4); /** * 11 */ - Value NUMBER_11 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 11); + NumericValue NUMBER_11 = new FloatValue(CSSUnit.CSS_NUMBER, 11); /** * 19 */ - Value NUMBER_19 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 19); + NumericValue NUMBER_19 = new FloatValue(CSSUnit.CSS_NUMBER, 19); /** * 20 */ - Value NUMBER_20 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 20); + NumericValue NUMBER_20 = new FloatValue(CSSUnit.CSS_NUMBER, 20); /** * 21 */ - Value NUMBER_21 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 21); + NumericValue NUMBER_21 = new FloatValue(CSSUnit.CSS_NUMBER, 21); /** * 25 */ - Value NUMBER_25 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 25); + NumericValue NUMBER_25 = new FloatValue(CSSUnit.CSS_NUMBER, 25); /** * 30 */ - Value NUMBER_30 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 30); + NumericValue NUMBER_30 = new FloatValue(CSSUnit.CSS_NUMBER, 30); /** * 32 */ - Value NUMBER_32 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 32); + NumericValue NUMBER_32 = new FloatValue(CSSUnit.CSS_NUMBER, 32); /** * 34 */ - Value NUMBER_34 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 34); + NumericValue NUMBER_34 = new FloatValue(CSSUnit.CSS_NUMBER, 34); /** * 35 */ - Value NUMBER_35 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 35); + NumericValue NUMBER_35 = new FloatValue(CSSUnit.CSS_NUMBER, 35); /** * 42 */ - Value NUMBER_42 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 42); + NumericValue NUMBER_42 = new FloatValue(CSSUnit.CSS_NUMBER, 42); /** * 43 */ - Value NUMBER_43 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 43); + NumericValue NUMBER_43 = new FloatValue(CSSUnit.CSS_NUMBER, 43); /** * 45 */ - Value NUMBER_45 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 45); + NumericValue NUMBER_45 = new FloatValue(CSSUnit.CSS_NUMBER, 45); /** * 46 */ - Value NUMBER_46 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 46); + NumericValue NUMBER_46 = new FloatValue(CSSUnit.CSS_NUMBER, 46); /** * 47 */ - Value NUMBER_47 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 47); + NumericValue NUMBER_47 = new FloatValue(CSSUnit.CSS_NUMBER, 47); /** * 50 */ - Value NUMBER_50 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 50); + NumericValue NUMBER_50 = new FloatValue(CSSUnit.CSS_NUMBER, 50); /** * 60 */ - Value NUMBER_60 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 60); + NumericValue NUMBER_60 = new FloatValue(CSSUnit.CSS_NUMBER, 60); /** * 61 */ - Value NUMBER_61 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 61); + NumericValue NUMBER_61 = new FloatValue(CSSUnit.CSS_NUMBER, 61); /** * 63 */ - Value NUMBER_63 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 63); + NumericValue NUMBER_63 = new FloatValue(CSSUnit.CSS_NUMBER, 63); /** * 64 */ - Value NUMBER_64 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 64); + NumericValue NUMBER_64 = new FloatValue(CSSUnit.CSS_NUMBER, 64); /** * 65 */ - Value NUMBER_65 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 65); + NumericValue NUMBER_65 = new FloatValue(CSSUnit.CSS_NUMBER, 65); /** * 69 */ - Value NUMBER_69 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 69); + NumericValue NUMBER_69 = new FloatValue(CSSUnit.CSS_NUMBER, 69); /** * 70 */ - Value NUMBER_70 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 70); + NumericValue NUMBER_70 = new FloatValue(CSSUnit.CSS_NUMBER, 70); /** * 71 */ - Value NUMBER_71 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 71); + NumericValue NUMBER_71 = new FloatValue(CSSUnit.CSS_NUMBER, 71); /** * 72 */ - Value NUMBER_72 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 72); + NumericValue NUMBER_72 = new FloatValue(CSSUnit.CSS_NUMBER, 72); /** * 75 */ - Value NUMBER_75 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 75); + NumericValue NUMBER_75 = new FloatValue(CSSUnit.CSS_NUMBER, 75); /** * 79 */ - Value NUMBER_79 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 79); + NumericValue NUMBER_79 = new FloatValue(CSSUnit.CSS_NUMBER, 79); /** * 80 */ - Value NUMBER_80 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 80); + NumericValue NUMBER_80 = new FloatValue(CSSUnit.CSS_NUMBER, 80); /** * 82 */ - Value NUMBER_82 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 82); + NumericValue NUMBER_82 = new FloatValue(CSSUnit.CSS_NUMBER, 82); /** * 85 */ - Value NUMBER_85 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 85); + NumericValue NUMBER_85 = new FloatValue(CSSUnit.CSS_NUMBER, 85); /** * 87 */ - Value NUMBER_87 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 87); + NumericValue NUMBER_87 = new FloatValue(CSSUnit.CSS_NUMBER, 87); /** * 90 */ - Value NUMBER_90 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 90); + NumericValue NUMBER_90 = new FloatValue(CSSUnit.CSS_NUMBER, 90); /** * 91 */ - Value NUMBER_91 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 91); + NumericValue NUMBER_91 = new FloatValue(CSSUnit.CSS_NUMBER, 91); /** * 92 */ - Value NUMBER_92 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 92); + NumericValue NUMBER_92 = new FloatValue(CSSUnit.CSS_NUMBER, 92); /** * 95 */ - Value NUMBER_95 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 95); + NumericValue NUMBER_95 = new FloatValue(CSSUnit.CSS_NUMBER, 95); /** * 96 */ - Value NUMBER_96 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 96); + NumericValue NUMBER_96 = new FloatValue(CSSUnit.CSS_NUMBER, 96); /** * 99 */ - Value NUMBER_99 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 99); + NumericValue NUMBER_99 = new FloatValue(CSSUnit.CSS_NUMBER, 99); /** * 102 */ - Value NUMBER_102 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 102); + NumericValue NUMBER_102 = new FloatValue(CSSUnit.CSS_NUMBER, 102); /** * 104 */ - Value NUMBER_104 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 104); + NumericValue NUMBER_104 = new FloatValue(CSSUnit.CSS_NUMBER, 104); /** * 105 */ - Value NUMBER_105 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 105); + NumericValue NUMBER_105 = new FloatValue(CSSUnit.CSS_NUMBER, 105); /** * 106 */ - Value NUMBER_106 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 106); + NumericValue NUMBER_106 = new FloatValue(CSSUnit.CSS_NUMBER, 106); /** * 107 */ - Value NUMBER_107 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 107); + NumericValue NUMBER_107 = new FloatValue(CSSUnit.CSS_NUMBER, 107); /** * 112 */ - Value NUMBER_112 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 112); + NumericValue NUMBER_112 = new FloatValue(CSSUnit.CSS_NUMBER, 112); /** * 113 */ - Value NUMBER_113 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 113); + NumericValue NUMBER_113 = new FloatValue(CSSUnit.CSS_NUMBER, 113); /** * 114 */ - Value NUMBER_114 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 114); + NumericValue NUMBER_114 = new FloatValue(CSSUnit.CSS_NUMBER, 114); /** * 119 */ - Value NUMBER_119 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 119); + NumericValue NUMBER_119 = new FloatValue(CSSUnit.CSS_NUMBER, 119); /** * 122 */ - Value NUMBER_122 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 122); + NumericValue NUMBER_122 = new FloatValue(CSSUnit.CSS_NUMBER, 122); /** * 123 */ - Value NUMBER_123 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 123); + NumericValue NUMBER_123 = new FloatValue(CSSUnit.CSS_NUMBER, 123); /** * 124 */ - Value NUMBER_124 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 124); + NumericValue NUMBER_124 = new FloatValue(CSSUnit.CSS_NUMBER, 124); /** * 127 */ - Value NUMBER_127 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 127); + NumericValue NUMBER_127 = new FloatValue(CSSUnit.CSS_NUMBER, 127); /** * 130 */ - Value NUMBER_130 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 130); + NumericValue NUMBER_130 = new FloatValue(CSSUnit.CSS_NUMBER, 130); /** * 133 */ - Value NUMBER_133 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 133); + NumericValue NUMBER_133 = new FloatValue(CSSUnit.CSS_NUMBER, 133); /** * 134 */ - Value NUMBER_134 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 134); + NumericValue NUMBER_134 = new FloatValue(CSSUnit.CSS_NUMBER, 134); /** * 135 */ - Value NUMBER_135 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 135); + NumericValue NUMBER_135 = new FloatValue(CSSUnit.CSS_NUMBER, 135); /** * 136 */ - Value NUMBER_136 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 136); + NumericValue NUMBER_136 = new FloatValue(CSSUnit.CSS_NUMBER, 136); /** * 138 */ - Value NUMBER_138 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 138); + NumericValue NUMBER_138 = new FloatValue(CSSUnit.CSS_NUMBER, 138); /** * 139 */ - Value NUMBER_139 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 139); + NumericValue NUMBER_139 = new FloatValue(CSSUnit.CSS_NUMBER, 139); /** * 140 */ - Value NUMBER_140 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 140); + NumericValue NUMBER_140 = new FloatValue(CSSUnit.CSS_NUMBER, 140); /** * 142 */ - Value NUMBER_142 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 142); + NumericValue NUMBER_142 = new FloatValue(CSSUnit.CSS_NUMBER, 142); /** * 143 */ - Value NUMBER_143 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 143); + NumericValue NUMBER_143 = new FloatValue(CSSUnit.CSS_NUMBER, 143); /** * 144 */ - Value NUMBER_144 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 144); + NumericValue NUMBER_144 = new FloatValue(CSSUnit.CSS_NUMBER, 144); /** * 147 */ - Value NUMBER_147 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 147); + NumericValue NUMBER_147 = new FloatValue(CSSUnit.CSS_NUMBER, 147); /** * 148 */ - Value NUMBER_148 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 148); + NumericValue NUMBER_148 = new FloatValue(CSSUnit.CSS_NUMBER, 148); /** * 149 */ - Value NUMBER_149 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 149); + NumericValue NUMBER_149 = new FloatValue(CSSUnit.CSS_NUMBER, 149); /** * 150 */ - Value NUMBER_150 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 150); + NumericValue NUMBER_150 = new FloatValue(CSSUnit.CSS_NUMBER, 150); /** * 152 */ - Value NUMBER_152 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 152); + NumericValue NUMBER_152 = new FloatValue(CSSUnit.CSS_NUMBER, 152); /** * 153 */ - Value NUMBER_153 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 153); + NumericValue NUMBER_153 = new FloatValue(CSSUnit.CSS_NUMBER, 153); /** * 154 */ - Value NUMBER_154 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 154); + NumericValue NUMBER_154 = new FloatValue(CSSUnit.CSS_NUMBER, 154); /** * 158 */ - Value NUMBER_158 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 158); + NumericValue NUMBER_158 = new FloatValue(CSSUnit.CSS_NUMBER, 158); /** * 160 */ - Value NUMBER_160 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 160); + NumericValue NUMBER_160 = new FloatValue(CSSUnit.CSS_NUMBER, 160); /** * 164 */ - Value NUMBER_164 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 164); + NumericValue NUMBER_164 = new FloatValue(CSSUnit.CSS_NUMBER, 164); /** * 165 */ - Value NUMBER_165 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 165); + NumericValue NUMBER_165 = new FloatValue(CSSUnit.CSS_NUMBER, 165); /** * 169 */ - Value NUMBER_169 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 169); + NumericValue NUMBER_169 = new FloatValue(CSSUnit.CSS_NUMBER, 169); /** * 170 */ - Value NUMBER_170 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 170); + NumericValue NUMBER_170 = new FloatValue(CSSUnit.CSS_NUMBER, 170); /** * 173 */ - Value NUMBER_173 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 173); + NumericValue NUMBER_173 = new FloatValue(CSSUnit.CSS_NUMBER, 173); /** * 175 */ - Value NUMBER_175 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 175); + NumericValue NUMBER_175 = new FloatValue(CSSUnit.CSS_NUMBER, 175); /** * 176 */ - Value NUMBER_176 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 176); + NumericValue NUMBER_176 = new FloatValue(CSSUnit.CSS_NUMBER, 176); /** * 178 */ - Value NUMBER_178 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 178); + NumericValue NUMBER_178 = new FloatValue(CSSUnit.CSS_NUMBER, 178); /** * 179 */ - Value NUMBER_179 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 179); + NumericValue NUMBER_179 = new FloatValue(CSSUnit.CSS_NUMBER, 179); /** * 180 */ - Value NUMBER_180 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 180); + NumericValue NUMBER_180 = new FloatValue(CSSUnit.CSS_NUMBER, 180); /** * 181 */ - Value NUMBER_181 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 181); + NumericValue NUMBER_181 = new FloatValue(CSSUnit.CSS_NUMBER, 181); /** * 182 */ - Value NUMBER_182 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 182); + NumericValue NUMBER_182 = new FloatValue(CSSUnit.CSS_NUMBER, 182); /** * 183 */ - Value NUMBER_183 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 183); + NumericValue NUMBER_183 = new FloatValue(CSSUnit.CSS_NUMBER, 183); /** * 184 */ - Value NUMBER_184 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 184); + NumericValue NUMBER_184 = new FloatValue(CSSUnit.CSS_NUMBER, 184); /** * 185 */ - Value NUMBER_185 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 185); + NumericValue NUMBER_185 = new FloatValue(CSSUnit.CSS_NUMBER, 185); /** * 186 */ - Value NUMBER_186 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 186); + NumericValue NUMBER_186 = new FloatValue(CSSUnit.CSS_NUMBER, 186); /** * 188 */ - Value NUMBER_188 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 188); + NumericValue NUMBER_188 = new FloatValue(CSSUnit.CSS_NUMBER, 188); /** * 189 */ - Value NUMBER_189 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 189); + NumericValue NUMBER_189 = new FloatValue(CSSUnit.CSS_NUMBER, 189); /** * 191 */ - Value NUMBER_191 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 191); + NumericValue NUMBER_191 = new FloatValue(CSSUnit.CSS_NUMBER, 191); /** * 193 */ - Value NUMBER_193 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 193); + NumericValue NUMBER_193 = new FloatValue(CSSUnit.CSS_NUMBER, 193); /** * 196 */ - Value NUMBER_196 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 196); + NumericValue NUMBER_196 = new FloatValue(CSSUnit.CSS_NUMBER, 196); /** * 199 */ - Value NUMBER_199 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 199); + NumericValue NUMBER_199 = new FloatValue(CSSUnit.CSS_NUMBER, 199); /** * 203 */ - Value NUMBER_203 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 203); + NumericValue NUMBER_203 = new FloatValue(CSSUnit.CSS_NUMBER, 203); /** * 204 */ - Value NUMBER_204 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 204); + NumericValue NUMBER_204 = new FloatValue(CSSUnit.CSS_NUMBER, 204); /** * 205 */ - Value NUMBER_205 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 205); + NumericValue NUMBER_205 = new FloatValue(CSSUnit.CSS_NUMBER, 205); /** * 206 */ - Value NUMBER_206 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 206); + NumericValue NUMBER_206 = new FloatValue(CSSUnit.CSS_NUMBER, 206); /** * 208 */ - Value NUMBER_208 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 208); + NumericValue NUMBER_208 = new FloatValue(CSSUnit.CSS_NUMBER, 208); /** * 209 */ - Value NUMBER_209 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 209); + NumericValue NUMBER_209 = new FloatValue(CSSUnit.CSS_NUMBER, 209); /** * 210 */ - Value NUMBER_210 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 210); + NumericValue NUMBER_210 = new FloatValue(CSSUnit.CSS_NUMBER, 210); /** * 211 */ - Value NUMBER_211 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 211); + NumericValue NUMBER_211 = new FloatValue(CSSUnit.CSS_NUMBER, 211); /** * 212 */ - Value NUMBER_212 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 212); + NumericValue NUMBER_212 = new FloatValue(CSSUnit.CSS_NUMBER, 212); /** * 213 */ - Value NUMBER_213 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 213); + NumericValue NUMBER_213 = new FloatValue(CSSUnit.CSS_NUMBER, 213); /** * 214 */ - Value NUMBER_214 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 214); + NumericValue NUMBER_214 = new FloatValue(CSSUnit.CSS_NUMBER, 214); /** * 215 */ - Value NUMBER_215 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 215); + NumericValue NUMBER_215 = new FloatValue(CSSUnit.CSS_NUMBER, 215); /** * 216 */ - Value NUMBER_216 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 216); + NumericValue NUMBER_216 = new FloatValue(CSSUnit.CSS_NUMBER, 216); /** * 218 */ - Value NUMBER_218 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 218); + NumericValue NUMBER_218 = new FloatValue(CSSUnit.CSS_NUMBER, 218); /** * 219 */ - Value NUMBER_219 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 219); + NumericValue NUMBER_219 = new FloatValue(CSSUnit.CSS_NUMBER, 219); /** * 220 */ - Value NUMBER_220 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 220); + NumericValue NUMBER_220 = new FloatValue(CSSUnit.CSS_NUMBER, 220); /** * 221 */ - Value NUMBER_221 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 221); + NumericValue NUMBER_221 = new FloatValue(CSSUnit.CSS_NUMBER, 221); /** * 222 */ - Value NUMBER_222 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 222); + NumericValue NUMBER_222 = new FloatValue(CSSUnit.CSS_NUMBER, 222); /** * 224 */ - Value NUMBER_224 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 224); + NumericValue NUMBER_224 = new FloatValue(CSSUnit.CSS_NUMBER, 224); /** * 225 */ - Value NUMBER_225 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 225); + NumericValue NUMBER_225 = new FloatValue(CSSUnit.CSS_NUMBER, 225); /** * 226 */ - Value NUMBER_226 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 226); + NumericValue NUMBER_226 = new FloatValue(CSSUnit.CSS_NUMBER, 226); /** * 228 */ - Value NUMBER_228 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 228); + NumericValue NUMBER_228 = new FloatValue(CSSUnit.CSS_NUMBER, 228); /** * 230 */ - Value NUMBER_230 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 230); + NumericValue NUMBER_230 = new FloatValue(CSSUnit.CSS_NUMBER, 230); /** * 232 */ - Value NUMBER_232 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 232); + NumericValue NUMBER_232 = new FloatValue(CSSUnit.CSS_NUMBER, 232); /** * 233 */ - Value NUMBER_233 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 233); + NumericValue NUMBER_233 = new FloatValue(CSSUnit.CSS_NUMBER, 233); /** * 235 */ - Value NUMBER_235 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 235); + NumericValue NUMBER_235 = new FloatValue(CSSUnit.CSS_NUMBER, 235); /** * 237 */ - Value NUMBER_237 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 237); + NumericValue NUMBER_237 = new FloatValue(CSSUnit.CSS_NUMBER, 237); /** * 238 */ - Value NUMBER_238 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 238); + NumericValue NUMBER_238 = new FloatValue(CSSUnit.CSS_NUMBER, 238); /** * 239 */ - Value NUMBER_239 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 239); + NumericValue NUMBER_239 = new FloatValue(CSSUnit.CSS_NUMBER, 239); /** * 240 */ - Value NUMBER_240 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 240); + NumericValue NUMBER_240 = new FloatValue(CSSUnit.CSS_NUMBER, 240); /** * 244 */ - Value NUMBER_244 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 244); + NumericValue NUMBER_244 = new FloatValue(CSSUnit.CSS_NUMBER, 244); /** * 245 */ - Value NUMBER_245 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 245); + NumericValue NUMBER_245 = new FloatValue(CSSUnit.CSS_NUMBER, 245); /** * 248 */ - Value NUMBER_248 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 248); + NumericValue NUMBER_248 = new FloatValue(CSSUnit.CSS_NUMBER, 248); /** * 250 */ - Value NUMBER_250 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 250); + NumericValue NUMBER_250 = new FloatValue(CSSUnit.CSS_NUMBER, 250); /** * 251 */ - Value NUMBER_251 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 251); + NumericValue NUMBER_251 = new FloatValue(CSSUnit.CSS_NUMBER, 251); /** * 252 */ - Value NUMBER_252 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 252); + NumericValue NUMBER_252 = new FloatValue(CSSUnit.CSS_NUMBER, 252); /** * 253 */ - Value NUMBER_253 = new FloatValue(CSSPrimitiveValue.CSS_NUMBER, 253); + NumericValue NUMBER_253 = new FloatValue(CSSUnit.CSS_NUMBER, 253); /** * The 'accumulate' keyword. */ - Value ACCUMULATE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ACCUMULATE_VALUE); + Value ACCUMULATE_VALUE = new IdentValue(CSSConstants.CSS_ACCUMULATE_VALUE); /** * The 'after-edge' keyword. */ - Value AFTER_EDGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_AFTER_EDGE_VALUE); + Value AFTER_EDGE_VALUE = new IdentValue(CSSConstants.CSS_AFTER_EDGE_VALUE); /** * The 'alphabetic' keyword. */ - Value ALPHABETIC_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ALPHABETIC_VALUE); + Value ALPHABETIC_VALUE = new IdentValue(CSSConstants.CSS_ALPHABETIC_VALUE); /** * The 'baseline' keyword. */ - Value BASELINE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BASELINE_VALUE); + Value BASELINE_VALUE = new IdentValue(CSSConstants.CSS_BASELINE_VALUE); /** * The 'before-edge' keyword. */ - Value BEFORE_EDGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BEFORE_EDGE_VALUE); + Value BEFORE_EDGE_VALUE = new IdentValue(CSSConstants.CSS_BEFORE_EDGE_VALUE); /** * The 'bevel' keyword. */ - Value BEVEL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BEVEL_VALUE); + Value BEVEL_VALUE = new IdentValue(CSSConstants.CSS_BEVEL_VALUE); /** * The 'butt' keyword. */ - Value BUTT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BUTT_VALUE); + Value BUTT_VALUE = new IdentValue(CSSConstants.CSS_BUTT_VALUE); /** * The 'central' keyword. */ - Value CENTRAL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CENTRAL_VALUE); + Value CENTRAL_VALUE = new IdentValue(CSSConstants.CSS_CENTRAL_VALUE); /** * The 'currentcolor' keyword. */ - Value CURRENTCOLOR_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CURRENTCOLOR_VALUE); + Value CURRENTCOLOR_VALUE = new IdentValue(CSSConstants.CSS_CURRENTCOLOR_VALUE); /** * The 'end' keyword. */ - Value END_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_END_VALUE); + Value END_VALUE = new IdentValue(CSSConstants.CSS_END_VALUE); /** * The 'evenodd' keyword. */ - Value EVENODD_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_EVENODD_VALUE); + Value EVENODD_VALUE = new IdentValue(CSSConstants.CSS_EVENODD_VALUE); /** * The 'fill' keyword. */ - Value FILL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_FILL_VALUE); + Value FILL_VALUE = new IdentValue(CSSConstants.CSS_FILL_VALUE); /** * The 'fillstroke' keyword. */ - Value FILLSTROKE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_FILLSTROKE_VALUE); + Value FILLSTROKE_VALUE = new IdentValue(CSSConstants.CSS_FILLSTROKE_VALUE); /** * The 'geometricprecision' keyword. */ - Value GEOMETRICPRECISION_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_GEOMETRICPRECISION_VALUE); + Value GEOMETRICPRECISION_VALUE = new IdentValue(CSSConstants.CSS_GEOMETRICPRECISION_VALUE); /** * The 'hanging' keyword. */ - Value HANGING_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_HANGING_VALUE); + Value HANGING_VALUE = new IdentValue(CSSConstants.CSS_HANGING_VALUE); /** * The 'ideographic' keyword. */ - Value IDEOGRAPHIC_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_IDEOGRAPHIC_VALUE); + Value IDEOGRAPHIC_VALUE = new IdentValue(CSSConstants.CSS_IDEOGRAPHIC_VALUE); /** * The 'linearRGB' keyword. */ - Value LINEARRGB_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LINEARRGB_VALUE); + Value LINEARRGB_VALUE = new IdentValue(CSSConstants.CSS_LINEARRGB_VALUE); /** * The 'lr' keyword. */ - Value LR_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LR_VALUE); + Value LR_VALUE = new IdentValue(CSSConstants.CSS_LR_VALUE); /** * The 'lr-tb' keyword. */ - Value LR_TB_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LR_TB_VALUE); + Value LR_TB_VALUE = new IdentValue(CSSConstants.CSS_LR_TB_VALUE); /** * The 'mathematical' keyword. */ - Value MATHEMATICAL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MATHEMATICAL_VALUE); + Value MATHEMATICAL_VALUE = new IdentValue(CSSConstants.CSS_MATHEMATICAL_VALUE); /** * The 'middle' keyword. */ - Value MIDDLE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MIDDLE_VALUE); + Value MIDDLE_VALUE = new IdentValue(CSSConstants.CSS_MIDDLE_VALUE); /** * The 'new' keyword. */ - Value NEW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NEW_VALUE); + Value NEW_VALUE = new IdentValue(CSSConstants.CSS_NEW_VALUE); /** * The 'miter' keyword. */ - Value MITER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MITER_VALUE); + Value MITER_VALUE = new IdentValue(CSSConstants.CSS_MITER_VALUE); /** * The 'no-change' keyword. */ - Value NO_CHANGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NO_CHANGE_VALUE); + Value NO_CHANGE_VALUE = new IdentValue(CSSConstants.CSS_NO_CHANGE_VALUE); /** * The 'nonzero' keyword. */ - Value NONZERO_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NONZERO_VALUE); + Value NONZERO_VALUE = new IdentValue(CSSConstants.CSS_NONZERO_VALUE); /** * The 'optimizeLegibility' keyword. */ - Value OPTIMIZELEGIBILITY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_OPTIMIZELEGIBILITY_VALUE); + Value OPTIMIZELEGIBILITY_VALUE = new IdentValue(CSSConstants.CSS_OPTIMIZELEGIBILITY_VALUE); /** * The 'optimizeQuality' keyword. */ - Value OPTIMIZEQUALITY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_OPTIMIZEQUALITY_VALUE); + Value OPTIMIZEQUALITY_VALUE = new IdentValue(CSSConstants.CSS_OPTIMIZEQUALITY_VALUE); /** * The 'optimizeSpeed' keyword. */ - Value OPTIMIZESPEED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_OPTIMIZESPEED_VALUE); + Value OPTIMIZESPEED_VALUE = new IdentValue(CSSConstants.CSS_OPTIMIZESPEED_VALUE); /** * The 'reset-size' keyword. */ - Value RESET_SIZE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_RESET_SIZE_VALUE); + Value RESET_SIZE_VALUE = new IdentValue(CSSConstants.CSS_RESET_SIZE_VALUE); /** * The 'rl' keyword. */ - Value RL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_RL_VALUE); + Value RL_VALUE = new IdentValue(CSSConstants.CSS_RL_VALUE); /** * The 'rl-tb' keyword. */ - Value RL_TB_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_RL_TB_VALUE); + Value RL_TB_VALUE = new IdentValue(CSSConstants.CSS_RL_TB_VALUE); /** * The 'round' keyword. */ - Value ROUND_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ROUND_VALUE); + Value ROUND_VALUE = new IdentValue(CSSConstants.CSS_ROUND_VALUE); /** * The 'square' keyword. */ - Value SQUARE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SQUARE_VALUE); + Value SQUARE_VALUE = new IdentValue(CSSConstants.CSS_SQUARE_VALUE); /** * The 'sRGB' keyword. */ - Value SRGB_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SRGB_VALUE); + Value SRGB_VALUE = new IdentValue(CSSConstants.CSS_SRGB_VALUE); /** * The 'start' keyword. */ - Value START_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_START_VALUE); + Value START_VALUE = new IdentValue(CSSConstants.CSS_START_VALUE); /** * The 'sub' keyword. */ - Value SUB_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SUB_VALUE); + Value SUB_VALUE = new IdentValue(CSSConstants.CSS_SUB_VALUE); /** * The 'super' keyword. */ - Value SUPER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SUPER_VALUE); + Value SUPER_VALUE = new IdentValue(CSSConstants.CSS_SUPER_VALUE); /** * The 'tb' keyword. */ - Value TB_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TB_VALUE); + Value TB_VALUE = new IdentValue(CSSConstants.CSS_TB_VALUE); /** * The 'tb-rl' keyword. */ - Value TB_RL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TB_RL_VALUE); + Value TB_RL_VALUE = new IdentValue(CSSConstants.CSS_TB_RL_VALUE); /** * The 'text-after-edge' keyword. */ - Value TEXT_AFTER_EDGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TEXT_AFTER_EDGE_VALUE); + Value TEXT_AFTER_EDGE_VALUE = new IdentValue(CSSConstants.CSS_TEXT_AFTER_EDGE_VALUE); /** * The 'text-before-edge' keyword. */ - Value TEXT_BEFORE_EDGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_TEXT_BEFORE_EDGE_VALUE); + Value TEXT_BEFORE_EDGE_VALUE = new IdentValue(CSSConstants.CSS_TEXT_BEFORE_EDGE_VALUE); /** * The 'text-bottom' keyword. */ - Value TEXT_BOTTOM_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TEXT_BOTTOM_VALUE); + Value TEXT_BOTTOM_VALUE = new IdentValue(CSSConstants.CSS_TEXT_BOTTOM_VALUE); /** * The 'text-top' keyword. */ - Value TEXT_TOP_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TEXT_TOP_VALUE); + Value TEXT_TOP_VALUE = new IdentValue(CSSConstants.CSS_TEXT_TOP_VALUE); /** * The 'use-script' keyword. */ - Value USE_SCRIPT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_USE_SCRIPT_VALUE); + Value USE_SCRIPT_VALUE = new IdentValue(CSSConstants.CSS_USE_SCRIPT_VALUE); /** * The 'visiblefill' keyword. */ - Value VISIBLEFILL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_VISIBLEFILL_VALUE); + Value VISIBLEFILL_VALUE = new IdentValue(CSSConstants.CSS_VISIBLEFILL_VALUE); /** * The 'visiblefillstroke' keyword. */ - Value VISIBLEFILLSTROKE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_VISIBLEFILLSTROKE_VALUE); + Value VISIBLEFILLSTROKE_VALUE = new IdentValue(CSSConstants.CSS_VISIBLEFILLSTROKE_VALUE); /** * The 'visiblepainted' keyword. */ - Value VISIBLEPAINTED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_VISIBLEPAINTED_VALUE); + Value VISIBLEPAINTED_VALUE = new IdentValue(CSSConstants.CSS_VISIBLEPAINTED_VALUE); /** * The 'visiblestroke' keyword. */ - Value VISIBLESTROKE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_VISIBLESTROKE_VALUE); + Value VISIBLESTROKE_VALUE = new IdentValue(CSSConstants.CSS_VISIBLESTROKE_VALUE); /** * The 'aliceblue' color name. */ - Value ALICEBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ALICEBLUE_VALUE); + Value ALICEBLUE_VALUE = new IdentValue(CSSConstants.CSS_ALICEBLUE_VALUE); /** * The 'antiquewhite' color name. */ - Value ANTIQUEWHITE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ANTIQUEWHITE_VALUE); + Value ANTIQUEWHITE_VALUE = new IdentValue(CSSConstants.CSS_ANTIQUEWHITE_VALUE); /** * The 'aquamarine' color name. */ - Value AQUAMARINE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_AQUAMARINE_VALUE); + Value AQUAMARINE_VALUE = new IdentValue(CSSConstants.CSS_AQUAMARINE_VALUE); /** * The 'azure' color name. */ - Value AZURE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_AZURE_VALUE); + Value AZURE_VALUE = new IdentValue(CSSConstants.CSS_AZURE_VALUE); /** * The 'beige' color name. */ - Value BEIGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BEIGE_VALUE); + Value BEIGE_VALUE = new IdentValue(CSSConstants.CSS_BEIGE_VALUE); /** * The 'bisque' color name. */ - Value BISQUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BISQUE_VALUE); + Value BISQUE_VALUE = new IdentValue(CSSConstants.CSS_BISQUE_VALUE); /** * The 'blanchedalmond' color name. */ - Value BLANCHEDALMOND_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BLANCHEDALMOND_VALUE); + Value BLANCHEDALMOND_VALUE = new IdentValue(CSSConstants.CSS_BLANCHEDALMOND_VALUE); /** * The 'blueviolet' color name. */ - Value BLUEVIOLET_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BLUEVIOLET_VALUE); + Value BLUEVIOLET_VALUE = new IdentValue(CSSConstants.CSS_BLUEVIOLET_VALUE); /** * The 'brown' color name. */ - Value BROWN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BROWN_VALUE); + Value BROWN_VALUE = new IdentValue(CSSConstants.CSS_BROWN_VALUE); /** * The 'burlywood' color name. */ - Value BURLYWOOD_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_BURLYWOOD_VALUE); + Value BURLYWOOD_VALUE = new IdentValue(CSSConstants.CSS_BURLYWOOD_VALUE); /** * The 'cadetblue' color name. */ - Value CADETBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CADETBLUE_VALUE); + Value CADETBLUE_VALUE = new IdentValue(CSSConstants.CSS_CADETBLUE_VALUE); /** * The 'chartreuse' color name. */ - Value CHARTREUSE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CHARTREUSE_VALUE); + Value CHARTREUSE_VALUE = new IdentValue(CSSConstants.CSS_CHARTREUSE_VALUE); /** * The 'chocolate' color name. */ - Value CHOCOLATE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CHOCOLATE_VALUE); + Value CHOCOLATE_VALUE = new IdentValue(CSSConstants.CSS_CHOCOLATE_VALUE); /** * The 'coral' color name. */ - Value CORAL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CORAL_VALUE); + Value CORAL_VALUE = new IdentValue(CSSConstants.CSS_CORAL_VALUE); /** * The 'cornflowerblue' color name. */ - Value CORNFLOWERBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CORNFLOWERBLUE_VALUE); + Value CORNFLOWERBLUE_VALUE = new IdentValue(CSSConstants.CSS_CORNFLOWERBLUE_VALUE); /** * The 'cornsilk' color name. */ - Value CORNSILK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CORNSILK_VALUE); + Value CORNSILK_VALUE = new IdentValue(CSSConstants.CSS_CORNSILK_VALUE); /** * The 'crimson' color name. */ - Value CRIMSON_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CRIMSON_VALUE); + Value CRIMSON_VALUE = new IdentValue(CSSConstants.CSS_CRIMSON_VALUE); /** * The 'cyan' color name. */ - Value CYAN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CYAN_VALUE); + Value CYAN_VALUE = new IdentValue(CSSConstants.CSS_CYAN_VALUE); /** * The 'darkblue' color name. */ - Value DARKBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKBLUE_VALUE); + Value DARKBLUE_VALUE = new IdentValue(CSSConstants.CSS_DARKBLUE_VALUE); /** * The 'darkcyan' color name. */ - Value DARKCYAN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKCYAN_VALUE); + Value DARKCYAN_VALUE = new IdentValue(CSSConstants.CSS_DARKCYAN_VALUE); /** * The 'darkgoldenrod' color name. */ - Value DARKGOLDENROD_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKGOLDENROD_VALUE); + Value DARKGOLDENROD_VALUE = new IdentValue(CSSConstants.CSS_DARKGOLDENROD_VALUE); /** * The 'darkgray' color name. */ - Value DARKGRAY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKGRAY_VALUE); + Value DARKGRAY_VALUE = new IdentValue(CSSConstants.CSS_DARKGRAY_VALUE); /** * The 'darkgreen' color name. */ - Value DARKGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKGREEN_VALUE); + Value DARKGREEN_VALUE = new IdentValue(CSSConstants.CSS_DARKGREEN_VALUE); /** * The 'darkgrey' color name. */ - Value DARKGREY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKGREY_VALUE); + Value DARKGREY_VALUE = new IdentValue(CSSConstants.CSS_DARKGREY_VALUE); /** * The 'darkkhaki' color name. */ - Value DARKKHAKI_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKKHAKI_VALUE); + Value DARKKHAKI_VALUE = new IdentValue(CSSConstants.CSS_DARKKHAKI_VALUE); /** * The 'darkmagenta' color name. */ - Value DARKMAGENTA_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKMAGENTA_VALUE); + Value DARKMAGENTA_VALUE = new IdentValue(CSSConstants.CSS_DARKMAGENTA_VALUE); /** * The 'darkolivegreen' color name. */ - Value DARKOLIVEGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKOLIVEGREEN_VALUE); + Value DARKOLIVEGREEN_VALUE = new IdentValue(CSSConstants.CSS_DARKOLIVEGREEN_VALUE); /** * The 'darkorange' color name. */ - Value DARKORANGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKORANGE_VALUE); + Value DARKORANGE_VALUE = new IdentValue(CSSConstants.CSS_DARKORANGE_VALUE); /** * The 'darkorchid' color name. */ - Value DARKORCHID_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKORCHID_VALUE); + Value DARKORCHID_VALUE = new IdentValue(CSSConstants.CSS_DARKORCHID_VALUE); /** * The 'darkred' color name. */ - Value DARKRED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKRED_VALUE); + Value DARKRED_VALUE = new IdentValue(CSSConstants.CSS_DARKRED_VALUE); /** * The 'darksalmon' color name. */ - Value DARKSALMON_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKSALMON_VALUE); + Value DARKSALMON_VALUE = new IdentValue(CSSConstants.CSS_DARKSALMON_VALUE); /** * The 'darkseagreen' color name. */ - Value DARKSEAGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKSEAGREEN_VALUE); + Value DARKSEAGREEN_VALUE = new IdentValue(CSSConstants.CSS_DARKSEAGREEN_VALUE); /** * The 'darkslateblue' color name. */ - Value DARKSLATEBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKSLATEBLUE_VALUE); + Value DARKSLATEBLUE_VALUE = new IdentValue(CSSConstants.CSS_DARKSLATEBLUE_VALUE); /** * The 'darkslategray' color name. */ - Value DARKSLATEGRAY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKSLATEGRAY_VALUE); + Value DARKSLATEGRAY_VALUE = new IdentValue(CSSConstants.CSS_DARKSLATEGRAY_VALUE); /** * The 'darkslategrey' color name. */ - Value DARKSLATEGREY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKSLATEGREY_VALUE); + Value DARKSLATEGREY_VALUE = new IdentValue(CSSConstants.CSS_DARKSLATEGREY_VALUE); /** * The 'darkturquoise' color name. */ - Value DARKTURQUOISE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKTURQUOISE_VALUE); + Value DARKTURQUOISE_VALUE = new IdentValue(CSSConstants.CSS_DARKTURQUOISE_VALUE); /** * The 'darkviolet' color name. */ - Value DARKVIOLET_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DARKVIOLET_VALUE); + Value DARKVIOLET_VALUE = new IdentValue(CSSConstants.CSS_DARKVIOLET_VALUE); /** * The 'deeppink' color name. */ - Value DEEPPINK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DEEPPINK_VALUE); + Value DEEPPINK_VALUE = new IdentValue(CSSConstants.CSS_DEEPPINK_VALUE); /** * The 'deepskyblue' color name. */ - Value DEEPSKYBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DEEPSKYBLUE_VALUE); + Value DEEPSKYBLUE_VALUE = new IdentValue(CSSConstants.CSS_DEEPSKYBLUE_VALUE); /** * The 'dimgray' color name. */ - Value DIMGRAY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DIMGRAY_VALUE); + Value DIMGRAY_VALUE = new IdentValue(CSSConstants.CSS_DIMGRAY_VALUE); /** * The 'dimgrey' color name. */ - Value DIMGREY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DIMGREY_VALUE); + Value DIMGREY_VALUE = new IdentValue(CSSConstants.CSS_DIMGREY_VALUE); /** * The 'dodgerblue' color name. */ - Value DODGERBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_DODGERBLUE_VALUE); + Value DODGERBLUE_VALUE = new IdentValue(CSSConstants.CSS_DODGERBLUE_VALUE); /** * The 'firebrick' color name. */ - Value FIREBRICK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_FIREBRICK_VALUE); + Value FIREBRICK_VALUE = new IdentValue(CSSConstants.CSS_FIREBRICK_VALUE); /** * The 'floralwhite' color name. */ - Value FLORALWHITE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_FLORALWHITE_VALUE); + Value FLORALWHITE_VALUE = new IdentValue(CSSConstants.CSS_FLORALWHITE_VALUE); /** * The 'forestgreen' color name. */ - Value FORESTGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_FORESTGREEN_VALUE); + Value FORESTGREEN_VALUE = new IdentValue(CSSConstants.CSS_FORESTGREEN_VALUE); /** * The 'gainsboro' color name. */ - Value GAINSBORO_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GAINSBORO_VALUE); + Value GAINSBORO_VALUE = new IdentValue(CSSConstants.CSS_GAINSBORO_VALUE); /** * The 'ghostwhite' color name. */ - Value GHOSTWHITE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GHOSTWHITE_VALUE); + Value GHOSTWHITE_VALUE = new IdentValue(CSSConstants.CSS_GHOSTWHITE_VALUE); /** * The 'gold' color name. */ - Value GOLD_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GOLD_VALUE); + Value GOLD_VALUE = new IdentValue(CSSConstants.CSS_GOLD_VALUE); /** * The 'goldenrod' color name. */ - Value GOLDENROD_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GOLDENROD_VALUE); + Value GOLDENROD_VALUE = new IdentValue(CSSConstants.CSS_GOLDENROD_VALUE); /** * The 'greenyellow' color name. */ - Value GREENYELLOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GREENYELLOW_VALUE); + Value GREENYELLOW_VALUE = new IdentValue(CSSConstants.CSS_GREENYELLOW_VALUE); /** * The 'grey' color name. */ - Value GREY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_GREY_VALUE); + Value GREY_VALUE = new IdentValue(CSSConstants.CSS_GREY_VALUE); /** * The 'honeydew' color name. */ - Value HONEYDEW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_HONEYDEW_VALUE); + Value HONEYDEW_VALUE = new IdentValue(CSSConstants.CSS_HONEYDEW_VALUE); /** * The 'hotpink' color name. */ - Value HOTPINK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_HOTPINK_VALUE); + Value HOTPINK_VALUE = new IdentValue(CSSConstants.CSS_HOTPINK_VALUE); /** * The 'indianred' color name. */ - Value INDIANRED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INDIANRED_VALUE); + Value INDIANRED_VALUE = new IdentValue(CSSConstants.CSS_INDIANRED_VALUE); /** * The 'indigo' color name. */ - Value INDIGO_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_INDIGO_VALUE); + Value INDIGO_VALUE = new IdentValue(CSSConstants.CSS_INDIGO_VALUE); /** * The 'ivory' color name. */ - Value IVORY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_IVORY_VALUE); + Value IVORY_VALUE = new IdentValue(CSSConstants.CSS_IVORY_VALUE); /** * The 'khaki' color name. */ - Value KHAKI_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_KHAKI_VALUE); + Value KHAKI_VALUE = new IdentValue(CSSConstants.CSS_KHAKI_VALUE); /** * The 'lavender' color name. */ - Value LAVENDER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LAVENDER_VALUE); + Value LAVENDER_VALUE = new IdentValue(CSSConstants.CSS_LAVENDER_VALUE); /** * The 'lavenderblush' color name. */ - Value LAVENDERBLUSH_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LAVENDERBLUSH_VALUE); + Value LAVENDERBLUSH_VALUE = new IdentValue(CSSConstants.CSS_LAVENDERBLUSH_VALUE); /** * The 'lawngreen' color name. */ - Value LAWNGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LAWNGREEN_VALUE); + Value LAWNGREEN_VALUE = new IdentValue(CSSConstants.CSS_LAWNGREEN_VALUE); /** * The 'lemonchiffon' color name. */ - Value LEMONCHIFFON_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LEMONCHIFFON_VALUE); + Value LEMONCHIFFON_VALUE = new IdentValue(CSSConstants.CSS_LEMONCHIFFON_VALUE); /** * The 'lightblue' color name. */ - Value LIGHTBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTBLUE_VALUE); + Value LIGHTBLUE_VALUE = new IdentValue(CSSConstants.CSS_LIGHTBLUE_VALUE); /** * The 'lightcoral' color name. */ - Value LIGHTCORAL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTCORAL_VALUE); + Value LIGHTCORAL_VALUE = new IdentValue(CSSConstants.CSS_LIGHTCORAL_VALUE); /** * The 'lightcyan' color name. */ - Value LIGHTCYAN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTCYAN_VALUE); + Value LIGHTCYAN_VALUE = new IdentValue(CSSConstants.CSS_LIGHTCYAN_VALUE); /** * The 'lightgoldenrodyellow' color name. */ - Value LIGHTGOLDENRODYELLOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_LIGHTGOLDENRODYELLOW_VALUE); + Value LIGHTGOLDENRODYELLOW_VALUE = new IdentValue(CSSConstants.CSS_LIGHTGOLDENRODYELLOW_VALUE); /** * The 'lightgray' color name. */ - Value LIGHTGRAY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTGRAY_VALUE); + Value LIGHTGRAY_VALUE = new IdentValue(CSSConstants.CSS_LIGHTGRAY_VALUE); /** * The 'lightgreen' color name. */ - Value LIGHTGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTGREEN_VALUE); + Value LIGHTGREEN_VALUE = new IdentValue(CSSConstants.CSS_LIGHTGREEN_VALUE); /** * The 'lightgrey' color name. */ - Value LIGHTGREY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTGREY_VALUE); + Value LIGHTGREY_VALUE = new IdentValue(CSSConstants.CSS_LIGHTGREY_VALUE); /** * The 'lightpink' color name. */ - Value LIGHTPINK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTPINK_VALUE); + Value LIGHTPINK_VALUE = new IdentValue(CSSConstants.CSS_LIGHTPINK_VALUE); /** * The 'lightsalmon' color name. */ - Value LIGHTSALMON_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTSALMON_VALUE); + Value LIGHTSALMON_VALUE = new IdentValue(CSSConstants.CSS_LIGHTSALMON_VALUE); /** * The 'lightseagreen' color name. */ - Value LIGHTSEAGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTSEAGREEN_VALUE); + Value LIGHTSEAGREEN_VALUE = new IdentValue(CSSConstants.CSS_LIGHTSEAGREEN_VALUE); /** * The 'lightskyblue' color name. */ - Value LIGHTSKYBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTSKYBLUE_VALUE); + Value LIGHTSKYBLUE_VALUE = new IdentValue(CSSConstants.CSS_LIGHTSKYBLUE_VALUE); /** * The 'lightslategray' color name. */ - Value LIGHTSLATEGRAY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTSLATEGRAY_VALUE); + Value LIGHTSLATEGRAY_VALUE = new IdentValue(CSSConstants.CSS_LIGHTSLATEGRAY_VALUE); /** * The 'lightslategrey' color name. */ - Value LIGHTSLATEGREY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTSLATEGREY_VALUE); + Value LIGHTSLATEGREY_VALUE = new IdentValue(CSSConstants.CSS_LIGHTSLATEGREY_VALUE); /** * The 'lightsteelblue' color name. */ - Value LIGHTSTEELBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTSTEELBLUE_VALUE); + Value LIGHTSTEELBLUE_VALUE = new IdentValue(CSSConstants.CSS_LIGHTSTEELBLUE_VALUE); /** * The 'lightyellow' color name. */ - Value LIGHTYELLOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIGHTYELLOW_VALUE); + Value LIGHTYELLOW_VALUE = new IdentValue(CSSConstants.CSS_LIGHTYELLOW_VALUE); /** * The 'limegreen' color name. */ - Value LIMEGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LIMEGREEN_VALUE); + Value LIMEGREEN_VALUE = new IdentValue(CSSConstants.CSS_LIMEGREEN_VALUE); /** * The 'linen' color name. */ - Value LINEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_LINEN_VALUE); + Value LINEN_VALUE = new IdentValue(CSSConstants.CSS_LINEN_VALUE); /** * The 'magenta' color name. */ - Value MAGENTA_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MAGENTA_VALUE); + Value MAGENTA_VALUE = new IdentValue(CSSConstants.CSS_MAGENTA_VALUE); /** * The 'mediumaquamarine' color name. */ - Value MEDIUMAQUAMARINE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_MEDIUMAQUAMARINE_VALUE); + Value MEDIUMAQUAMARINE_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMAQUAMARINE_VALUE); /** * The 'mediumblue' color name. */ - Value MEDIUMBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MEDIUMBLUE_VALUE); + Value MEDIUMBLUE_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMBLUE_VALUE); /** * The 'mediumorchid' color name. */ - Value MEDIUMORCHID_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MEDIUMORCHID_VALUE); + Value MEDIUMORCHID_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMORCHID_VALUE); /** * The 'mediumpurple' color name. */ - Value MEDIUMPURPLE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MEDIUMPURPLE_VALUE); + Value MEDIUMPURPLE_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMPURPLE_VALUE); /** * The 'mediumseagreen' color name. */ - Value MEDIUMSEAGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MEDIUMSEAGREEN_VALUE); + Value MEDIUMSEAGREEN_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMSEAGREEN_VALUE); /** * The 'mediumslateblue' color name. */ - Value MEDIUMSLATEBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MEDIUMSLATEBLUE_VALUE); + Value MEDIUMSLATEBLUE_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMSLATEBLUE_VALUE); /** * The 'mediumspringgreen' color name. */ - Value MEDIUMSPRINGGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, - CSSConstants.CSS_MEDIUMSPRINGGREEN_VALUE); + Value MEDIUMSPRINGGREEN_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMSPRINGGREEN_VALUE); /** * The 'mediumturquoise' color name. */ - Value MEDIUMTURQUOISE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MEDIUMTURQUOISE_VALUE); + Value MEDIUMTURQUOISE_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMTURQUOISE_VALUE); /** * The 'mediumvioletred' color name. */ - Value MEDIUMVIOLETRED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MEDIUMVIOLETRED_VALUE); + Value MEDIUMVIOLETRED_VALUE = new IdentValue(CSSConstants.CSS_MEDIUMVIOLETRED_VALUE); /** * The 'midnightblue' color name. */ - Value MIDNIGHTBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MIDNIGHTBLUE_VALUE); + Value MIDNIGHTBLUE_VALUE = new IdentValue(CSSConstants.CSS_MIDNIGHTBLUE_VALUE); /** * The 'mintcream' color name. */ - Value MINTCREAM_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MINTCREAM_VALUE); + Value MINTCREAM_VALUE = new IdentValue(CSSConstants.CSS_MINTCREAM_VALUE); /** * The 'mistyrose' color name. */ - Value MISTYROSE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MISTYROSE_VALUE); + Value MISTYROSE_VALUE = new IdentValue(CSSConstants.CSS_MISTYROSE_VALUE); /** * The 'moccasin' color name. */ - Value MOCCASIN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_MOCCASIN_VALUE); + Value MOCCASIN_VALUE = new IdentValue(CSSConstants.CSS_MOCCASIN_VALUE); /** * The 'navajowhite' color name. */ - Value NAVAJOWHITE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_NAVAJOWHITE_VALUE); + Value NAVAJOWHITE_VALUE = new IdentValue(CSSConstants.CSS_NAVAJOWHITE_VALUE); /** * The 'oldlace' color name. */ - Value OLDLACE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_OLDLACE_VALUE); + Value OLDLACE_VALUE = new IdentValue(CSSConstants.CSS_OLDLACE_VALUE); /** * The 'olivedrab' color name. */ - Value OLIVEDRAB_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_OLIVEDRAB_VALUE); + Value OLIVEDRAB_VALUE = new IdentValue(CSSConstants.CSS_OLIVEDRAB_VALUE); /** * The 'orange' color name. */ - Value ORANGE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ORANGE_VALUE); + Value ORANGE_VALUE = new IdentValue(CSSConstants.CSS_ORANGE_VALUE); /** * The 'orangered' color name. */ - Value ORANGERED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ORANGERED_VALUE); + Value ORANGERED_VALUE = new IdentValue(CSSConstants.CSS_ORANGERED_VALUE); /** * The 'orchid' color name. */ - Value ORCHID_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ORCHID_VALUE); + Value ORCHID_VALUE = new IdentValue(CSSConstants.CSS_ORCHID_VALUE); /** * The 'palegoldenrod' color name. */ - Value PALEGOLDENROD_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PALEGOLDENROD_VALUE); + Value PALEGOLDENROD_VALUE = new IdentValue(CSSConstants.CSS_PALEGOLDENROD_VALUE); /** * The 'palegreen' color name. */ - Value PALEGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PALEGREEN_VALUE); + Value PALEGREEN_VALUE = new IdentValue(CSSConstants.CSS_PALEGREEN_VALUE); /** * The 'paleturquoise' color name. */ - Value PALETURQUOISE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PALETURQUOISE_VALUE); + Value PALETURQUOISE_VALUE = new IdentValue(CSSConstants.CSS_PALETURQUOISE_VALUE); /** * The 'palevioletred' color name. */ - Value PALEVIOLETRED_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PALEVIOLETRED_VALUE); + Value PALEVIOLETRED_VALUE = new IdentValue(CSSConstants.CSS_PALEVIOLETRED_VALUE); /** * The 'papayawhip' color name. */ - Value PAPAYAWHIP_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PAPAYAWHIP_VALUE); + Value PAPAYAWHIP_VALUE = new IdentValue(CSSConstants.CSS_PAPAYAWHIP_VALUE); /** * The 'peachpuff' color name. */ - Value PEACHPUFF_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PEACHPUFF_VALUE); + Value PEACHPUFF_VALUE = new IdentValue(CSSConstants.CSS_PEACHPUFF_VALUE); /** * The 'peru' color name. */ - Value PERU_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PERU_VALUE); + Value PERU_VALUE = new IdentValue(CSSConstants.CSS_PERU_VALUE); /** * The 'pink' color name. */ - Value PINK_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PINK_VALUE); + Value PINK_VALUE = new IdentValue(CSSConstants.CSS_PINK_VALUE); /** * The 'plum' color name. */ - Value PLUM_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PLUM_VALUE); + Value PLUM_VALUE = new IdentValue(CSSConstants.CSS_PLUM_VALUE); /** * The 'powderblue' color name. */ - Value POWDERBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_POWDERBLUE_VALUE); + Value POWDERBLUE_VALUE = new IdentValue(CSSConstants.CSS_POWDERBLUE_VALUE); /** * The 'purple' color name. */ - Value PURPLE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_PURPLE_VALUE); + Value PURPLE_VALUE = new IdentValue(CSSConstants.CSS_PURPLE_VALUE); /** * The 'rosybrown' color name. */ - Value ROSYBROWN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ROSYBROWN_VALUE); + Value ROSYBROWN_VALUE = new IdentValue(CSSConstants.CSS_ROSYBROWN_VALUE); /** * The 'royalblue' color name. */ - Value ROYALBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_ROYALBLUE_VALUE); + Value ROYALBLUE_VALUE = new IdentValue(CSSConstants.CSS_ROYALBLUE_VALUE); /** * The 'saddlebrown' color name. */ - Value SADDLEBROWN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SADDLEBROWN_VALUE); + Value SADDLEBROWN_VALUE = new IdentValue(CSSConstants.CSS_SADDLEBROWN_VALUE); /** * The 'salmon' color name. */ - Value SALMON_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SALMON_VALUE); + Value SALMON_VALUE = new IdentValue(CSSConstants.CSS_SALMON_VALUE); /** * The 'sandybrown' color name. */ - Value SANDYBROWN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SANDYBROWN_VALUE); + Value SANDYBROWN_VALUE = new IdentValue(CSSConstants.CSS_SANDYBROWN_VALUE); /** * The 'seagreen' color name. */ - Value SEAGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SEAGREEN_VALUE); + Value SEAGREEN_VALUE = new IdentValue(CSSConstants.CSS_SEAGREEN_VALUE); /** * The 'seashell' color name. */ - Value SEASHELL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SEASHELL_VALUE); + Value SEASHELL_VALUE = new IdentValue(CSSConstants.CSS_SEASHELL_VALUE); /** * The 'sienna' color name. */ - Value SIENNA_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SIENNA_VALUE); + Value SIENNA_VALUE = new IdentValue(CSSConstants.CSS_SIENNA_VALUE); /** * The 'skyblue' color name. */ - Value SKYBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SKYBLUE_VALUE); + Value SKYBLUE_VALUE = new IdentValue(CSSConstants.CSS_SKYBLUE_VALUE); /** * The 'slateblue' color name. */ - Value SLATEBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SLATEBLUE_VALUE); + Value SLATEBLUE_VALUE = new IdentValue(CSSConstants.CSS_SLATEBLUE_VALUE); /** * The 'slategray' color name. */ - Value SLATEGRAY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SLATEGRAY_VALUE); + Value SLATEGRAY_VALUE = new IdentValue(CSSConstants.CSS_SLATEGRAY_VALUE); /** * The 'slategrey' color name. */ - Value SLATEGREY_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SLATEGREY_VALUE); + Value SLATEGREY_VALUE = new IdentValue(CSSConstants.CSS_SLATEGREY_VALUE); /** * The 'snow' color name. */ - Value SNOW_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SNOW_VALUE); + Value SNOW_VALUE = new IdentValue(CSSConstants.CSS_SNOW_VALUE); /** * The 'springgreen' color name. */ - Value SPRINGGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_SPRINGGREEN_VALUE); + Value SPRINGGREEN_VALUE = new IdentValue(CSSConstants.CSS_SPRINGGREEN_VALUE); /** * The 'steelblue' color name. */ - Value STEELBLUE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_STEELBLUE_VALUE); + Value STEELBLUE_VALUE = new IdentValue(CSSConstants.CSS_STEELBLUE_VALUE); /** * The 'tan' color name. */ - Value TAN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TAN_VALUE); + Value TAN_VALUE = new IdentValue(CSSConstants.CSS_TAN_VALUE); /** * The 'thistle' color name. */ - Value THISTLE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_THISTLE_VALUE); + Value THISTLE_VALUE = new IdentValue(CSSConstants.CSS_THISTLE_VALUE); /** * The 'tomato' color name. */ - Value TOMATO_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TOMATO_VALUE); + Value TOMATO_VALUE = new IdentValue(CSSConstants.CSS_TOMATO_VALUE); /** * The 'turquoise' color name. */ - Value TURQUOISE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_TURQUOISE_VALUE); + Value TURQUOISE_VALUE = new IdentValue(CSSConstants.CSS_TURQUOISE_VALUE); /** * The 'violet' color name. */ - Value VIOLET_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_VIOLET_VALUE); + Value VIOLET_VALUE = new IdentValue(CSSConstants.CSS_VIOLET_VALUE); /** * The 'wheat' color name. */ - Value WHEAT_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_WHEAT_VALUE); + Value WHEAT_VALUE = new IdentValue(CSSConstants.CSS_WHEAT_VALUE); /** * The 'whitesmoke' color name. */ - Value WHITESMOKE_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_WHITESMOKE_VALUE); + Value WHITESMOKE_VALUE = new IdentValue(CSSConstants.CSS_WHITESMOKE_VALUE); /** * The 'yellowgreen' color name. */ - Value YELLOWGREEN_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_YELLOWGREEN_VALUE); + Value YELLOWGREEN_VALUE = new IdentValue(CSSConstants.CSS_YELLOWGREEN_VALUE); /** * The 'aliceblue' RGB color. diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SpacingManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SpacingManager.java index 3e307b3eb..85c7f57f9 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SpacingManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/SpacingManager.java @@ -19,9 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.value.LengthManager; import io.sf.carte.echosvg.css.engine.value.Value; @@ -33,8 +33,10 @@ /** * This class provides a manager for the '*-spacing' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class SpacingManager extends LengthManager { @@ -119,12 +121,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return super.createValue(lu, engine); } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } if (value.equalsIgnoreCase(CSSConstants.CSS_NORMAL_VALUE)) { diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/StrokeDasharrayManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/StrokeDasharrayManager.java index 14fce3047..fa976a1f1 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/StrokeDasharrayManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/StrokeDasharrayManager.java @@ -19,10 +19,9 @@ package io.sf.carte.echosvg.css.engine.value.svg; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -37,8 +36,10 @@ /** * This class provides a factory for the 'stroke-dasharray' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class StrokeDasharrayManager extends LengthManager { @@ -120,12 +121,9 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { } } - /** - * Implements {@link ValueManager#createStringValue(short,String,CSSEngine)}. - */ @Override - public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException { - if (type != CSSPrimitiveValue.CSS_IDENT) { + public Value createStringValue(Type type, String value, CSSEngine engine) throws DOMException { + if (type != Type.IDENT) { throw createInvalidStringTypeDOMException(type); } if (value.equalsIgnoreCase(CSSConstants.CSS_NONE_VALUE)) { @@ -142,16 +140,18 @@ public Value createStringValue(short type, String value, CSSEngine engine) throw public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { switch (value.getCssValueType()) { - case CSSValue.CSS_PRIMITIVE_VALUE: + case TYPED: return value; + case LIST: + ListValue result = new ListValue(' '); + for (int i = 0; i < value.getLength(); i++) { + result.append(super.computeValue(elt, pseudo, engine, idx, sm, value.item(i))); + } + return result; + default: + throw createDOMException(); } - ListValue lv = (ListValue) value; - ListValue result = new ListValue(' '); - for (int i = 0; i < lv.getLength(); i++) { - result.append(super.computeValue(elt, pseudo, engine, idx, sm, lv.item(i))); - } - return result; } /** diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/StrokeMiterlimitManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/StrokeMiterlimitManager.java index 94117a433..7a3203431 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/StrokeMiterlimitManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg/StrokeMiterlimitManager.java @@ -18,8 +18,8 @@ */ package io.sf.carte.echosvg.css.engine.value.svg; +import org.w3c.css.om.unit.CSSUnit; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.echosvg.css.engine.CSSEngine; @@ -34,8 +34,10 @@ /** * This class provides a factory for the 'stroke-miterlimit' property values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class StrokeMiterlimitManager extends AbstractValueManager { @@ -98,10 +100,10 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { return ValueConstants.INHERIT_VALUE; case INTEGER: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getIntegerValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getIntegerValue()); case REAL: - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, lu.getFloatValue()); + return new FloatValue(CSSUnit.CSS_NUMBER, lu.getFloatValue()); default: throw createInvalidLexicalUnitDOMException(lu.getLexicalUnitType()); @@ -113,7 +115,7 @@ public Value createValue(LexicalUnit lu, CSSEngine engine) throws DOMException { */ @Override public Value createFloatValue(short unitType, float floatValue) throws DOMException { - if (unitType == CSSPrimitiveValue.CSS_NUMBER) { + if (unitType == CSSUnit.CSS_NUMBER) { return new FloatValue(unitType, floatValue); } throw createInvalidFloatTypeDOMException(unitType); diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/AbstractCIEColor.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/AbstractCIEColor.java index 3d909795e..f0af88ee1 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/AbstractCIEColor.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/AbstractCIEColor.java @@ -18,9 +18,7 @@ */ package io.sf.carte.echosvg.css.engine.value.svg12; -import org.w3c.dom.css.CSSValue; - -import io.sf.carte.echosvg.css.engine.value.AbstractValue; +import io.sf.carte.echosvg.css.engine.value.ColorValue; /** * This is a base class for CIE Lab/LCH color values. @@ -28,7 +26,7 @@ * @author For later modifications, see Git history. * @version $Id$ */ -public abstract class AbstractCIEColor extends AbstractValue { +public abstract class AbstractCIEColor extends ColorValue { /** The three color values. */ protected float[] values = new float[3]; @@ -78,15 +76,6 @@ public float[] getWhitePoint() { public abstract String getFunctionName(); - /** - * Implements - * {@link io.sf.carte.echosvg.css.engine.value.Value#getCssValueType()}. - */ - @Override - public short getCssValueType() { - return CSSValue.CSS_CUSTOM; - } - /** * A string representation of the current value. */ diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/CIELCHColor.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/CIELCHColor.java deleted file mode 100644 index d7c6f4b4d..000000000 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/CIELCHColor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - */ -package io.sf.carte.echosvg.css.engine.value.svg12; - -/** - * This class represents an CIE LCH color value. - * - * @author For later modifications, see Git history. - * @version $Id$ - */ -public class CIELCHColor extends AbstractCIEColor { - - public static final String CIE_LCH_COLOR_FUNCTION = "cielch"; - - /** - * Creates a new CIELCHColor. - * - * @param l the lightness (L) value - * @param c the chroma (C) value - * @param h the hue (H) value - * @param whitepoint the white point in CIE XYZ coordinates - */ - public CIELCHColor(float l, float c, float h, float[] whitepoint) { - super(new float[] { l, c, h }, whitepoint); - } - - /** - * Creates a new CIELCHColor with D65 as illuminant. - * - * @param l the lightness (L) value - * @param c the chroma (C) value - * @param h the hue (H) value - */ - public CIELCHColor(float l, float c, float h) { - this(l, c, h, null); - } - - /** {@inheritDoc} */ - @Override - public String getFunctionName() { - return CIE_LCH_COLOR_FUNCTION; - } - -} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/CIELabColor.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/CIELabColor.java deleted file mode 100644 index 95b6e2d35..000000000 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/CIELabColor.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - */ -package io.sf.carte.echosvg.css.engine.value.svg12; - -/** - * This class represents an CIE L*a*b* color value. - * - * @author For later modifications, see Git history. - * @version $Id$ - */ -public class CIELabColor extends AbstractCIEColor { - - public static final String CIE_LAB_COLOR_FUNCTION = "cielab"; - - /** - * Creates a new CIELabColor. - * - * @param l the L* value - * @param a the a* value - * @param b the b* value - * @param whitepoint the white point in CIE XYZ coordinates - */ - public CIELabColor(float l, float a, float b, float[] whitepoint) { - super(new float[] { l, a, b }, whitepoint); - } - - /** - * Creates a new CIELabColor with D50 as illuminant. - */ - public CIELabColor(float l, float a, float b) { - this(l, a, b, null); - } - - /** {@inheritDoc} */ - @Override - public String getFunctionName() { - return CIE_LAB_COLOR_FUNCTION; - } - -} diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/DeviceColor.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/DeviceColor.java index cf6d71e12..8ff887d13 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/DeviceColor.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/DeviceColor.java @@ -19,17 +19,16 @@ package io.sf.carte.echosvg.css.engine.value.svg12; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSValue; -import io.sf.carte.echosvg.css.engine.value.AbstractValue; +import io.sf.carte.echosvg.css.engine.value.ColorValue; /** * This class represents an device-specific color value. * - * @author For later modifications, see Git history. * @version $Id$ */ -public class DeviceColor extends AbstractValue { +@Deprecated +public class DeviceColor extends ColorValue { public static final String DEVICE_GRAY_COLOR_FUNCTION = "device-gray"; public static final String DEVICE_RGB_COLOR_FUNCTION = "device-rgb"; @@ -58,15 +57,6 @@ public DeviceColor(boolean nChannel) { this.nChannel = nChannel; } - /** - * Implements - * {@link io.sf.carte.echosvg.css.engine.value.Value#getCssValueType()}. - */ - @Override - public short getCssValueType() { - return CSSValue.CSS_CUSTOM; - } - /** * Indicates whether this color uses an N-Channel color space. * @@ -90,6 +80,38 @@ public float getColor(int i) throws DOMException { return colors[i]; } + @Override + public String getCSSColorSpace() { + String cs; + if (nChannel) { + cs = DEVICE_NCHANNEL_COLOR_FUNCTION; + } else { + switch (count) { + case 1: + cs = DEVICE_GRAY_COLOR_FUNCTION; + break; + case 3: + cs = DEVICE_RGB_COLOR_FUNCTION; + break; + case 4: + cs = DEVICE_CMYK_COLOR_FUNCTION; + break; + default: + throw new IllegalStateException("Invalid number of components encountered"); + } + } + return cs; + } + + @Override + public DeviceColor clone() { + DeviceColor c = (DeviceColor) super.clone(); + c.nChannel = nChannel; + c.count = count; + c.colors = colors.clone(); + return c; + } + /** * A string representation of the current value. */ diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/ICCNamedColor.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/ICCNamedColor.java index ef5fd4c2a..744207c66 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/ICCNamedColor.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/ICCNamedColor.java @@ -19,17 +19,16 @@ package io.sf.carte.echosvg.css.engine.value.svg12; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSValue; -import io.sf.carte.echosvg.css.engine.value.AbstractValue; +import io.sf.carte.echosvg.css.engine.value.ColorValue; /** * This class represents an ICC named color value. * - * @author For later modifications, see Git history. * @version $Id$ */ -public class ICCNamedColor extends AbstractValue { +@Deprecated +public class ICCNamedColor extends ColorValue { public static final String ICC_NAMED_COLOR_FUNCTION = "icc-named-color"; @@ -51,13 +50,9 @@ public ICCNamedColor(String profileName, String colorName) { this.colorName = colorName; } - /** - * Implements - * {@link io.sf.carte.echosvg.css.engine.value.Value#getCssValueType()}. - */ @Override - public short getCssValueType() { - return CSSValue.CSS_CUSTOM; + public String getCSSColorSpace() { + return colorProfile; } /** @@ -74,6 +69,14 @@ public String getColorName() throws DOMException { return colorName; } + @Override + public ColorValue clone() { + ICCNamedColor c = (ICCNamedColor) super.clone(); + c.colorName = colorName; + c.colorProfile = colorProfile; + return c; + } + /** * A string representation of the current value. */ diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/LineHeightManager.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/LineHeightManager.java index cf96e4374..b067c0bfc 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/LineHeightManager.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/LineHeightManager.java @@ -20,9 +20,8 @@ package io.sf.carte.echosvg.css.engine.value.svg12; import org.w3c.dom.DOMException; -import org.w3c.dom.css.CSSPrimitiveValue; -import org.w3c.dom.css.CSSValue; +import org.w3c.css.om.unit.CSSUnit; import io.sf.carte.doc.style.css.nsac.LexicalUnit; import io.sf.carte.echosvg.css.engine.CSSEngine; import io.sf.carte.echosvg.css.engine.CSSStylableElement; @@ -39,8 +38,10 @@ /** * This class provides a factory for the 'margin-*' properties values. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public class LineHeightManager extends LengthManager { @@ -132,18 +133,18 @@ protected int getOrientation() { @Override public Value computeValue(CSSStylableElement elt, String pseudo, CSSEngine engine, int idx, StyleMap sm, Value value) { - if (value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE) + if (value.getCssValueType() != Value.CssType.TYPED) return value; - switch (value.getPrimitiveType()) { - case CSSPrimitiveValue.CSS_NUMBER: - return new LineHeightValue(CSSPrimitiveValue.CSS_NUMBER, value.getFloatValue(), true); + switch (value.getCSSUnit()) { + case CSSUnit.CSS_NUMBER: + return new LineHeightValue(CSSUnit.CSS_NUMBER, value.getFloatValue(), true); - case CSSPrimitiveValue.CSS_PERCENTAGE: { + case CSSUnit.CSS_PERCENTAGE: { float v = value.getFloatValue(); int fsidx = engine.getFontSizeIndex(); float fs = engine.getComputedStyle(elt, pseudo, fsidx).getFloatValue(); - return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * fs * 0.01f); + return new FloatValue(CSSUnit.CSS_NUMBER, v * fs * 0.01f); } default: diff --git a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/SVG12ValueConstants.java b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/SVG12ValueConstants.java index 0d53a5355..18afe845d 100644 --- a/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/SVG12ValueConstants.java +++ b/echosvg-css/src/main/java/io/sf/carte/echosvg/css/engine/value/svg12/SVG12ValueConstants.java @@ -19,9 +19,7 @@ package io.sf.carte.echosvg.css.engine.value.svg12; -import org.w3c.dom.css.CSSPrimitiveValue; - -import io.sf.carte.echosvg.css.engine.value.StringValue; +import io.sf.carte.echosvg.css.engine.value.IdentValue; import io.sf.carte.echosvg.css.engine.value.Value; import io.sf.carte.echosvg.css.engine.value.svg.SVGValueConstants; import io.sf.carte.echosvg.util.CSSConstants; @@ -30,21 +28,23 @@ /** * This interface provides constants for SVG 1.2 values. * - * @author deweese - * @author For later modifications, see Git history. + *

+ * Original author: deweese. + * For later modifications, see Git history. + *

* @version $Id$ */ public interface SVG12ValueConstants extends SVGValueConstants { /** The 'start' keyword. */ - Value START_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, SVG12CSSConstants.CSS_FULL_VALUE); + Value START_VALUE = new IdentValue(SVG12CSSConstants.CSS_START_VALUE); /** The 'center' keyword. */ - Value CENTER_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, CSSConstants.CSS_CENTER_VALUE); + Value CENTER_VALUE = new IdentValue(CSSConstants.CSS_CENTER_VALUE); /** The 'end' keyword. */ - Value END_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, SVG12CSSConstants.CSS_END_VALUE); + Value END_VALUE = new IdentValue(SVG12CSSConstants.CSS_END_VALUE); /** The 'full' keyword. */ - Value FULL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, SVG12CSSConstants.CSS_FULL_VALUE); + Value FULL_VALUE = new IdentValue(SVG12CSSConstants.CSS_FULL_VALUE); /** The 'normal' keyword, for 'line-height'. */ - Value NORMAL_VALUE = new StringValue(CSSPrimitiveValue.CSS_IDENT, SVG12CSSConstants.CSS_NORMAL_VALUE); + Value NORMAL_VALUE = new IdentValue(SVG12CSSConstants.CSS_NORMAL_VALUE); } diff --git a/echosvg-css/src/main/java/module-info.java b/echosvg-css/src/main/java/module-info.java index 46c922146..b8ae3f6f8 100644 --- a/echosvg-css/src/main/java/module-info.java +++ b/echosvg-css/src/main/java/module-info.java @@ -20,6 +20,7 @@ * CSS support. */ module io.sf.carte.echosvg.css { + exports io.sf.carte.echosvg.css; exports io.sf.carte.echosvg.css.engine; exports io.sf.carte.echosvg.css.engine.value.css2; exports io.sf.carte.echosvg.css.engine.value.svg; @@ -33,6 +34,7 @@ requires transitive io.sf.carte.css4j; requires io.sf.carte.util; requires transitive org.w3c.dom.svg; + requires transitive org.w3c.dom.view; requires java.xml; requires jdk.xml.dom; diff --git a/echosvg-css/src/main/resources/io/sf/carte/echosvg/css/engine/value/resources/Messages.properties b/echosvg-css/src/main/resources/io/sf/carte/echosvg/css/engine/value/resources/Messages.properties index f8e3d835d..30f1da964 100644 --- a/echosvg-css/src/main/resources/io/sf/carte/echosvg/css/engine/value/resources/Messages.properties +++ b/echosvg-css/src/main/resources/io/sf/carte/echosvg/css/engine/value/resources/Messages.properties @@ -22,17 +22,11 @@ invalid.access = \ The invoked method is not enabled for the "{0}" property. invalid.value.access = \ -The invoked method cannot be called for {0,choice,\ -0#the inherit value|\ -1#a primitive value|\ -2#the value list|\ -3#a custom value\ -} type. +The invoked method cannot be called for {0} type. invalid.string.type = \ The given string type ({1}) is invalid for \ -the "{0}" property \ -(see org.w3c.dom.css.CSSPrimitiveValue). +the "{0}" property. invalid.identifier = \ The "{1}" identifier is not a valid value for the "{0}" property. @@ -46,16 +40,7 @@ malformed.rect = \ The ''{0}'' property value is malformed. invalid.float.type = \ -The given CSS primitive value ({1,choice,\ -0#CSS_UNKNOWN|\ -19#CSS_STRING|\ -20#CSS_URI|\ -30#CSS_IDENT|\ -31#CSS_ATTR|\ -32#CSS_COUNTER|\ -33#CSS_RECT|\ -34#CSS_RGBCOLOR\ -}) represents an invalid type for the "{0}". +The given CSS primitive value ({1}) represents an invalid type for the "{0}". invalid.float.value = \ The number ''{1}'' represents an invalid value for the ''{0}'' property. diff --git a/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/AbstractStylableDocument.java b/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/AbstractStylableDocument.java index 519d19a70..75a705d33 100644 --- a/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/AbstractStylableDocument.java +++ b/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/AbstractStylableDocument.java @@ -19,12 +19,12 @@ package io.sf.carte.echosvg.dom; +import org.w3c.css.om.CSSStyleDeclaration; import org.w3c.dom.DOMImplementation; import org.w3c.dom.DocumentType; import org.w3c.dom.Element; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.DocumentCSS; import org.w3c.dom.stylesheets.StyleSheetList; +import org.w3c.dom.view.DocumentCSS; import org.w3c.dom.views.AbstractView; import org.w3c.dom.views.DocumentView; diff --git a/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/ExtensibleDOMImplementation.java b/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/ExtensibleDOMImplementation.java index 4d0e6b011..0a6ac758c 100644 --- a/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/ExtensibleDOMImplementation.java +++ b/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/ExtensibleDOMImplementation.java @@ -29,7 +29,7 @@ import org.w3c.dom.DocumentType; import org.w3c.dom.Element; import org.w3c.dom.css.DOMImplementationCSS; -import org.w3c.dom.css.ViewCSS; +import org.w3c.dom.view.ViewCSS; import io.sf.carte.doc.style.css.nsac.Parser; import io.sf.carte.doc.style.css.parser.CSSParser; diff --git a/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/util/CSSStyleDeclarationFactory.java b/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/util/CSSStyleDeclarationFactory.java index 789bfa509..f17c17a7c 100644 --- a/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/util/CSSStyleDeclarationFactory.java +++ b/echosvg-dom/src/main/java/io/sf/carte/echosvg/dom/util/CSSStyleDeclarationFactory.java @@ -18,13 +18,15 @@ */ package io.sf.carte.echosvg.dom.util; -import org.w3c.dom.css.CSSStyleDeclaration; +import org.w3c.css.om.CSSStyleDeclaration; /** * This interface represents CSSStyleDeclaration factories. * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ public interface CSSStyleDeclarationFactory { diff --git a/echosvg-dom/src/main/java/module-info.java b/echosvg-dom/src/main/java/module-info.java index efb7f0ad6..6789d62dc 100644 --- a/echosvg-dom/src/main/java/module-info.java +++ b/echosvg-dom/src/main/java/module-info.java @@ -37,6 +37,8 @@ requires io.sf.carte.xml.dtd; + requires transitive org.w3c.dom.view; + requires transitive java.xml; requires transitive jdk.xml.dom; diff --git a/echosvg-extension/src/main/java/io/sf/carte/echosvg/extension/StylableExtensionElement.java b/echosvg-extension/src/main/java/io/sf/carte/echosvg/extension/StylableExtensionElement.java index 0af8f556e..1f8fc3cb6 100644 --- a/echosvg-extension/src/main/java/io/sf/carte/echosvg/extension/StylableExtensionElement.java +++ b/echosvg-extension/src/main/java/io/sf/carte/echosvg/extension/StylableExtensionElement.java @@ -18,12 +18,13 @@ */ package io.sf.carte.echosvg.extension; +import org.w3c.css.om.CSSStyleDeclaration; +import org.w3c.css.om.typed.CSSStyleValue; import org.w3c.dom.Node; -import org.w3c.dom.css.CSSStyleDeclaration; -import org.w3c.dom.css.CSSValue; import org.w3c.dom.svg.SVGAnimatedString; -import org.w3c.dom.svg.SVGStylable; +import org.w3c.dom.svg.SVGStylableP; +import io.sf.carte.echosvg.css.dom.CSSValue; import io.sf.carte.echosvg.css.engine.CSSStylableElement; import io.sf.carte.echosvg.css.engine.StyleDeclarationProvider; import io.sf.carte.echosvg.css.engine.StyleMap; @@ -35,11 +36,14 @@ * usable as a foreign element within an SVGOMDocument, and the support for both * the 'style' attribute and the style attributes (ie: fill="red", ...). * - * @author Stephane Hillion - * @author For later modifications, see Git history. + *

+ * Original author: Stephane Hillion. + * For later modifications, see Git history. + *

* @version $Id$ */ -public abstract class StylableExtensionElement extends ExtensionElement implements CSSStylableElement, SVGStylable { +public abstract class StylableExtensionElement extends ExtensionElement implements CSSStylableElement, + SVGStylableP { private static final long serialVersionUID = 1L; diff --git a/echosvg-test/src/test/java/io/sf/carte/echosvg/bridge/test/ModificationsTest.java b/echosvg-test/src/test/java/io/sf/carte/echosvg/bridge/test/ModificationsTest.java new file mode 100644 index 000000000..ea0c2399f --- /dev/null +++ b/echosvg-test/src/test/java/io/sf/carte/echosvg/bridge/test/ModificationsTest.java @@ -0,0 +1,134 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.bridge.test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.awt.Dimension; +import java.awt.geom.Dimension2D; + +import org.junit.jupiter.api.Test; +import org.w3c.css.om.CSSStyleDeclaration; +import org.w3c.css.om.typed.CSSStyleValue; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Element; +import org.w3c.dom.svg.SVGDocument; +import org.w3c.dom.svg.SVGSVGElement; +import org.w3c.dom.view.ViewCSS; +import org.w3c.dom.views.DocumentView; + +import io.sf.carte.echosvg.anim.dom.SVGDOMImplementation; +import io.sf.carte.echosvg.anim.dom.SVGStylableElement; +import io.sf.carte.echosvg.bridge.BridgeContext; +import io.sf.carte.echosvg.bridge.GVTBuilder; +import io.sf.carte.echosvg.bridge.UserAgentAdapter; +import io.sf.carte.echosvg.constants.XMLConstants; +import io.sf.carte.echosvg.css.dom.CSSValue; +import io.sf.carte.echosvg.css.dom.CSSValue.CssType; +import io.sf.carte.echosvg.gvt.GraphicsNode; +import io.sf.carte.echosvg.util.CSSConstants; +import io.sf.carte.echosvg.util.SVGConstants; + +/** + * Test value modifications. + */ +public class ModificationsTest { + + @Test + void testFillRGB() { + CSSStyleValue value = updateValue(CSSConstants.CSS_FILL_PROPERTY, "rgb(120, 30, 200)", + "color(display-p3 0.6 0.2 0.7)"); + assertNotNull(value); + } + + @Test + void testFillColorFunction() { + CSSStyleValue value = updateValue(CSSConstants.CSS_FILL_PROPERTY, "color(display-p3 0.6 0.2 0.7)", + "rgb(120, 30, 200)"); + assertNotNull(value); + } + + static CSSStyleValue updateValue(String ptyName, String ptyValue, String newValue) { + BridgeContext ctx = createBridgeContext(); + SVGDocument doc = createDocumentWithStyle(ptyName + ':' + ptyValue); + GraphicsNode gn = createGraphicsNode(ctx, doc); + assertNotNull(gn); + SVGStylableElement rect = (SVGStylableElement) doc.getElementById("rect1"); + assertNotNull(rect); + + ViewCSS view = (ViewCSS) ((DocumentView) doc).getDefaultView(); + CSSStyleDeclaration cs = view.getComputedStyle(rect, null); + CSSValue val = (CSSValue) cs.getCSSStyleValue(ptyName); + + assertNotNull(val); + assertEquals(CssType.TYPED, val.getCssValueType()); + assertEquals(ptyValue, val.getCssText()); + + rect.getStyle().setProperty(ptyName, newValue, null); + String styleDecl = ptyName + ": " + newValue + ';'; + assertEquals(styleDecl, rect.getStyle().getCssText().replace("\n", "")); + assertEquals(styleDecl, rect.getAttribute("style").replace("\n", "")); + + cs = view.getComputedStyle(rect, null); + CSSStyleValue modval = cs.getCSSStyleValue(ptyName); + + assertNotNull(modval); + assertEquals(newValue, modval.toString()); + + return modval; + } + + private static SVGDocument createDocumentWithStyle(String rectStyle) { + DOMImplementation impl = SVGDOMImplementation.getDOMImplementation(); + DocumentType dtd = impl.createDocumentType("svg", "-//W3C//DTD SVG 1.1//EN", + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"); + SVGDocument doc = (SVGDocument) impl.createDocument(SVGConstants.SVG_NAMESPACE_URI, + SVGConstants.SVG_SVG_TAG, dtd); + SVGSVGElement svg = doc.getRootElement(); + svg.setAttribute("width", "200"); + svg.setAttribute("height", "200"); + Element rect = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI, SVGConstants.SVG_RECT_TAG); + rect.setAttribute(XMLConstants.XML_ID_ATTRIBUTE, "rect1"); + rect.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, rectStyle); + svg.appendChild(rect); + return doc; + } + + private static BridgeContext createBridgeContext() { + BridgeContext ctx = new BridgeContext(new UserAgentAdapter() { + + @Override + public Dimension2D getViewportSize() { + return new Dimension(200, 200); + } + + }); + ctx.setDynamic(true); + + return ctx; + } + + private static GraphicsNode createGraphicsNode(BridgeContext ctx, Document document) { + return new GVTBuilder().build(ctx, document); + } + +} diff --git a/echosvg-test/src/test/java/io/sf/carte/echosvg/bridge/test/PaintServerTest.java b/echosvg-test/src/test/java/io/sf/carte/echosvg/bridge/test/PaintServerTest.java new file mode 100644 index 000000000..fa50f2259 --- /dev/null +++ b/echosvg-test/src/test/java/io/sf/carte/echosvg/bridge/test/PaintServerTest.java @@ -0,0 +1,162 @@ +/* + + See the NOTICE file distributed with this work for additional + information regarding copyright ownership. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + */ +package io.sf.carte.echosvg.bridge.test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Paint; +import java.awt.geom.Dimension2D; + +import org.junit.jupiter.api.Test; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Element; +import org.w3c.dom.svg.SVGDocument; +import org.w3c.dom.svg.SVGSVGElement; + +import io.sf.carte.echosvg.anim.dom.SVGDOMImplementation; +import io.sf.carte.echosvg.bridge.BridgeContext; +import io.sf.carte.echosvg.bridge.CSSUtilities; +import io.sf.carte.echosvg.bridge.GVTBuilder; +import io.sf.carte.echosvg.bridge.PaintServer; +import io.sf.carte.echosvg.bridge.UserAgentAdapter; +import io.sf.carte.echosvg.constants.XMLConstants; +import io.sf.carte.echosvg.css.dom.CSSValue.Type; +import io.sf.carte.echosvg.css.engine.CSSEngine; +import io.sf.carte.echosvg.css.engine.CSSStylableElement; +import io.sf.carte.echosvg.css.engine.value.ColorValue; +import io.sf.carte.echosvg.css.engine.value.Value; +import io.sf.carte.echosvg.gvt.GraphicsNode; +import io.sf.carte.echosvg.util.CSSConstants; +import io.sf.carte.echosvg.util.SVGConstants; + +/** + * Test PaintServer. + */ +public class PaintServerTest { + + @Test + public void testConvertRGB() { + Color color = convertPaint(CSSConstants.CSS_FILL_PROPERTY, "rgb(120, 30, 200)", + ColorValue.RGB_FUNCTION); + assertNotNull(color); + assertEquals(120, color.getRed()); + assertEquals(30, color.getGreen()); + assertEquals(200, color.getBlue()); + assertEquals(255, color.getAlpha()); + } + + @Test + public void testConvertColorFunction() { + Color color = convertPaint(CSSConstants.CSS_FILL_PROPERTY, "color(display-p3 0.6 0.2 0.7)", + ColorValue.CS_DISPLAY_P3); + assertNotNull(color); + float[] comp = new float[3]; + color.getColorComponents(comp); + assertEquals(.6f, comp[0]); + assertEquals(.2f, comp[1]); + assertEquals(.7f, comp[2]); + assertEquals(255, color.getAlpha()); + } + + @Test + public void testConvertColorFunctionXYZD50() { + Color color = convertPaint(CSSConstants.CSS_FILL_PROPERTY, "color(xyz-d50 0.06 0.08 0.09 / 0.969)", + ColorValue.CS_XYZ_D50); + assertNotNull(color); + float[] comp = new float[3]; + color.getColorComponents(comp); + assertEquals(.06f, comp[0], 1e-5f); + assertEquals(.08f, comp[1], 1e-5f); + assertEquals(.09f, comp[2], 1e-5f); + assertEquals(247, color.getAlpha()); + } + + @Test + public void testConvertColorFunctionXYZD65() { + Color color = convertPaint(CSSConstants.CSS_FILL_PROPERTY, "color(xyz-d65 0.065 0.033 0.06 / 0.2)", + ColorValue.CS_XYZ_D65); + assertNotNull(color); + float[] comp = new float[3]; + color.getColorComponents(comp); + assertEquals(.06586f, comp[0], 1e-5f); // D50 + assertEquals(.0335833f, comp[1], 1e-5f); // D50 + assertEquals(.045024f, comp[2], 1e-5f); // D50 + assertEquals(51, color.getAlpha()); + } + + private static Color convertPaint(String ptyName, String paintDef, String cssSpace) { + BridgeContext ctx = createBridgeContext(); + SVGDocument doc = createDocumentWithPaint(ptyName + ':' + paintDef); + GraphicsNode gn = createGraphicsNode(ctx, doc); + CSSStylableElement rect = (CSSStylableElement) doc.getElementById("rect1"); + assertNotNull(rect); + + CSSEngine cssEng = CSSUtilities.getCSSEngine(rect); + int index = cssEng.getPropertyIndex(ptyName); + Value val = cssEng.getComputedStyle(rect, null, index); + + assertNotNull(val); + assertEquals(Type.COLOR, val.getPrimitiveType()); + ColorValue cssColor = val.getColorValue(); + assertEquals(cssSpace, cssColor.getCSSColorSpace()); + assertEquals(paintDef, cssColor.getCssText()); + + Paint paint = PaintServer.convertPaint(rect, gn, val, 1f, ctx); + assertNotNull(paint); + + return PaintServer.convertColor(cssColor, 1f); + } + + private static SVGDocument createDocumentWithPaint(String rectStyle) { + DOMImplementation impl = SVGDOMImplementation.getDOMImplementation(); + DocumentType dtd = impl.createDocumentType("svg", "-//W3C//DTD SVG 1.1//EN", + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"); + SVGDocument doc = (SVGDocument) impl.createDocument(SVGConstants.SVG_NAMESPACE_URI, + SVGConstants.SVG_SVG_TAG, dtd); + SVGSVGElement svg = doc.getRootElement(); + svg.setAttribute("width", "200"); + svg.setAttribute("height", "200"); + Element rect = doc.createElementNS(SVGConstants.SVG_NAMESPACE_URI, SVGConstants.SVG_RECT_TAG); + rect.setAttribute(XMLConstants.XML_ID_ATTRIBUTE, "rect1"); + rect.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, rectStyle); + svg.appendChild(rect); + return doc; + } + + private static BridgeContext createBridgeContext() { + return new BridgeContext(new UserAgentAdapter() { + + @Override + public Dimension2D getViewportSize() { + return new Dimension(200, 200); + } + + }); + } + + private static GraphicsNode createGraphicsNode(BridgeContext ctx, Document document) { + return new GVTBuilder().build(ctx, document); + } + +} diff --git a/echosvg-test/src/test/java/io/sf/carte/echosvg/svggen/test/FontDecoration.java b/echosvg-test/src/test/java/io/sf/carte/echosvg/svggen/test/FontDecoration.java index ff1ba8780..2323a37f5 100644 --- a/echosvg-test/src/test/java/io/sf/carte/echosvg/svggen/test/FontDecoration.java +++ b/echosvg-test/src/test/java/io/sf/carte/echosvg/svggen/test/FontDecoration.java @@ -79,6 +79,7 @@ public void paint(Graphics2D g) { float[] comps = { 0.33f, 0.34f, 0.43f }; stColor = new Color(cs, comps, 1f); } catch (IOException e) { + e.printStackTrace(); stColor = new Color(0x666699); } // The color will be translated to XYZ (D50) @@ -101,6 +102,7 @@ public void paint(Graphics2D g) { float[] comps = { .55f, .6f, .34f }; lColor = new Color(cs, comps, 1f); } catch (IOException e) { + e.printStackTrace(); lColor = Color.magenta; } @@ -119,6 +121,7 @@ public void paint(Graphics2D g) { float[] comps = { .36f, .35f, .33f }; ulColor = new Color(cs, comps, 1f); } catch (IOException e) { + e.printStackTrace(); ulColor = Color.black; } diff --git a/echosvg-test/src/test/java/io/sf/carte/echosvg/test/svg/SamplesCanvgRenderingTest.java b/echosvg-test/src/test/java/io/sf/carte/echosvg/test/svg/SamplesCanvgRenderingTest.java index 3f3dfb632..7134857f7 100644 --- a/echosvg-test/src/test/java/io/sf/carte/echosvg/test/svg/SamplesCanvgRenderingTest.java +++ b/echosvg-test/src/test/java/io/sf/carte/echosvg/test/svg/SamplesCanvgRenderingTest.java @@ -913,7 +913,7 @@ public void testIssue289() throws TranscoderException, IOException { */ @Test public void testIssue320() throws TranscoderException, IOException { - testNVErrIgnore("samples/canvg/issue320.svg", BROWSER_MEDIA, 1); + testNV("samples/canvg/issue320.svg"); } @Test @@ -1049,7 +1049,7 @@ public void testIssue620() throws TranscoderException, IOException { @Test public void testIssue690() throws TranscoderException, IOException { - testNVErrIgnore("samples/canvg/issue690.svg", BROWSER_MEDIA, 4); + testNV("samples/canvg/issue690.svg"); } @Test diff --git a/echosvg-test/src/test/java/io/sf/carte/echosvg/test/svg/SamplesSpecRenderingTest.java b/echosvg-test/src/test/java/io/sf/carte/echosvg/test/svg/SamplesSpecRenderingTest.java index 31dbd5cf0..729213f8e 100644 --- a/echosvg-test/src/test/java/io/sf/carte/echosvg/test/svg/SamplesSpecRenderingTest.java +++ b/echosvg-test/src/test/java/io/sf/carte/echosvg/test/svg/SamplesSpecRenderingTest.java @@ -27,6 +27,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import io.sf.carte.echosvg.test.ScriptUtil; import io.sf.carte.echosvg.test.TestFonts; import io.sf.carte.echosvg.transcoder.TranscoderException; @@ -47,6 +48,7 @@ public class SamplesSpecRenderingTest extends AbstractSamplesRendering { @BeforeAll public static void setUpBeforeClass() throws Exception { TestFonts.loadTestFonts(); + ScriptUtil.defaultRhinoShutter(); } /* diff --git a/gradle.properties b/gradle.properties index 59c8f269d..3c5adc532 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,8 @@ css4jAwtVersion=4.0 xmlDtdVersion=4.3 rhinoVersion=1.7.15 legacyColorsVersion=1.0 -svgomVersion=1.0.1 +domViewVersion=1.0 +svgomVersion=1.1 xmlApisVersion=1.4.01 commonsIOVersion=2.16.1 htmlParserVersion=1.4.16 diff --git a/samples/tests/spec/scripting/domSVGColor.svg b/samples/tests/spec/scripting/domSVGColor.svg index 9a97c3915..126e4ebd7 100644 --- a/samples/tests/spec/scripting/domSVGColor.svg +++ b/samples/tests/spec/scripting/domSVGColor.svg @@ -23,8 +23,8 @@ - - + + @@ -45,60 +45,67 @@ test(); } - function showFill(id, suff) { + function showFill(id, suff, newValue) { var elem = document.getElementById(id); - var fill = elem.style.getPropertyCSSValue("fill"); - var tb = document.getElementById(id+suff); - tb.appendChild(document.createTextNode(fill.getCssText())); + var st = elem.style; + var fill = st.getCSSStyleValue("fill"); + var tb = document.getElementById(id+suff); + var text = fill.getCssText(); + tb.appendChild(document.createTextNode(text)); + if (newValue) { + st.setProperty("fill", newValue, ""); + fill = st.getCSSStyleValue("fill"); + } return fill; } function test() { var fill, r, g, b; - fill = showFill("r1", ".b"); - fill.setCssText("gold"); - showFill("r1", ".a"); - - fill = showFill("r2", ".b"); - fill.setCssText("gold"); - showFill("r2", ".a"); + fill = showFill("r1", ".b", "gold"); + showFill("r1", ".a"); - fill = showFill("r3", ".b"); - r = fill.getRed(); r.setCssText("50"); - showFill("r3", ".a"); + fill = showFill("r2", ".b"); + r = fill.getR(); r.setValue(31.4); + fill.b.setValue(50); + showFill("r2", ".a"); - fill = showFill("r4", ".b"); - r = fill.getRed(); r.setFloatValue(UNIT_NUMBER, 50); - showFill("r4", ".a"); - - fill = showFill("r5", ".b"); - r = fill.getRed(); r.setFloatValue(UNIT_NUMBER, 128); - showFill("r5", ".a"); - - fill = showFill("r6", ".b"); - g = fill.getGreen(); g.setCssText("50"); - showFill("r6", ".a"); + fill = showFill("r3", ".b"); + r = fill.getR(); r.setValue(19.6); + showFill("r3", ".a"); + + fill = showFill("r4", ".b", "color(display-p3 0.94 0.55 0.31)"); + fill.item(2).setValue(0.64); + showFill("r4", ".a"); + + fill = showFill("r5", ".b"); + r = fill.getR(); r.setValue("128"); + fill.setAlpha(0.95); + showFill("r5", ".a"); + + fill = showFill("r6", ".b"); + g = fill.getG(); g.setValue("19.6%"); + showFill("r6", ".a"); - fill = showFill("r7", ".b"); - g = fill.getGreen(); g.setFloatValue(UNIT_PERCENT, 19.6); - showFill("r7", ".a"); + fill = showFill("r7", ".b"); + g = fill.getG(); g.setValue(19.6); + showFill("r7", ".a"); - fill = showFill("r8", ".b"); - g = fill.getGreen(); g.setFloatValue(UNIT_NUMBER, 128); - showFill("r8", ".a"); + fill = showFill("r8", ".b"); + g = fill.getG(); g.setValue("50%"); + showFill("r8", ".a"); - fill = showFill("r9", ".b"); - b = fill.getBlue(); b.setCssText("50"); - showFill("r9", ".a"); - - fill = showFill("r10", ".b"); - b = fill.getBlue(); b.setFloatValue(UNIT_NUMBER, 50); - showFill("r10", ".a"); + fill = showFill("r9", ".b"); + b = fill.getB(); b.setValue("50"); + showFill("r9", ".a"); + + fill = showFill("r10", ".b"); + b = fill.getB(); b.setValue(19.6); + showFill("r10", ".a"); - fill = showFill("r11", ".b"); - fill.setCssText("rgb(220, 0, 128, 0.87)"); - showFill("r11", ".a"); + fill = showFill("r11", ".b", "rgba(220, 0, 128, 1)"); + fill.setAlpha(0.87); + showFill("r11", ".a"); } ]]> diff --git a/samples/tests/spec/scripting/paintType.svg b/samples/tests/spec/scripting/paintType.svg index 2c3cab35f..439eddde3 100644 --- a/samples/tests/spec/scripting/paintType.svg +++ b/samples/tests/spec/scripting/paintType.svg @@ -54,7 +54,7 @@ function getType(id, attr) { var e = document.getElementById(id); - var pa = e.getPresentationAttribute(attr); + var pa = e.getPresentationAttributeValue(attr); var pt = pa.paintType; var txt; if (pt == UNKNOWN) txt="UNKNOWN"; diff --git a/samples/tests/spec/scripting/relativeURI.svg b/samples/tests/spec/scripting/relativeURI.svg index a83684761..dcbaa2b61 100644 --- a/samples/tests/spec/scripting/relativeURI.svg +++ b/samples/tests/spec/scripting/relativeURI.svg @@ -83,7 +83,7 @@ function init() { cssStyle.setProperty("cursor", "url(#cur),crosshair",""); localStr = cssStyle.getPropertyValue("cursor"); - absStr = computedStyle.getPropertyCSSValue("cursor"); + absStr = computedStyle.getCSSStyleValue("cursor"); absStr = absStr.item(0).getCssText(); t3.firstChild.nodeValue = unifyURL(localStr); t4.firstChild.nodeValue = unifyURL(absStr); diff --git a/samples/tests/spec/scripting/setProperty.svg b/samples/tests/spec/scripting/setProperty.svg index 5960648bd..e26db294d 100644 --- a/samples/tests/spec/scripting/setProperty.svg +++ b/samples/tests/spec/scripting/setProperty.svg @@ -49,7 +49,7 @@ e = document.getElementById("r2"); style = e.getStyle(); - var paint = style.getPropertyCSSValue("fill"); + var paint = style.getCSSStyleValue("fill"); paint.setPaint(SVGPaint.SVG_PAINTTYPE_URI, "#lg", "", ""); if (paint.getPaintType() != SVGPaint.SVG_PAINTTYPE_URI) throw ("Wrong paint type: " + paint.getPaintType()); diff --git a/test-references/io/sf/carte/echosvg/svggen/rendering/ContextDrawImageICC.png b/test-references/io/sf/carte/echosvg/svggen/rendering/ContextDrawImageICC.png index 9f13bf707c595f350e6d11dd1f5cc8e97875675d..73c0be7d355833b9dab82fcbf34434fe9ae7f6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p__lqeVlBWc#VoOMb!r_an^1SMf;zq>{mw4w8rS=(wCx>JN z_Lq)CH07*)FY)wsEqhYb%%_q(Zip6=ElNoL2w2Kcemr`3z8q3V0c**Cnj7X1c2j}q zZwfjkmb!}=-4j-8xk~`KD_GTRH+CSVBON^_zu0a6OO7bX^((qF@YvD3r++LvYNKxD zeFNlif{Bry-qrMfP1dJV>Gay3lgUf6%e@R8#E&I;xiXNCR%ur5O%b_$*B0r+h2d|xkHL7 zgZ5!D_UE$D&UR58wN9NwI00?IAcgUv?ilXIsv5S0dHr@`Mdlzib6h#hXw-)^bV&vc zIaugKPb@9GugY|NLBx1AEDm%p%y1$TPg&ljytF0DdCJLQQ^%@>Z1V~R7t(RGf#;9I zX}v>bEsQnrLcv(lt8sa`$v5L>5mRCKcFhGJ9*DKdfy#~S_2Y8a88)F?+$SikEZ08Q z@aeRLF6gb;S;Ka9+hp8p>rS;tub diff --git a/test-references/io/sf/carte/echosvg/svggen/rendering/DrawImageICC.png b/test-references/io/sf/carte/echosvg/svggen/rendering/DrawImageICC.png index 4a96bffc048d9b86b756ed1c3ce5bb3b0010cc42..9ebad569bb43480c00771819acb5e3a319fd2dd5 100644 GIT binary patch delta 931 zcmX@feVlv3lzKT&7srr_TW{}f%oYxmIq>oRQ648|S*_6NI(mz?Y}?`KIDOYI`5V5w zvqfZPEpu|*y(84!-JN~9pV*@ifz^}$H}Z)wDamG?Yg!;C#C>&o%)0sfBDY?D_;k;D zU(79QAw~uSaGmtk#!7DIQq2i|^J}FHzeYXzy7x$ZbIgvpHF9sapEpu}S`hO4Z_?V} zrklDonn%@4=lM@bl6(F=*>wNxiU}*PIicljF=MtHs{EboJR?7Yc^cCC&a`d){wy1#HtX%(8S6y z*_(yag89<-i*t70y*NK+dr;r`&!68&$q4EEc)#zOl3lN=tWx*++hS209^B83?Tgqy ztE9tg&6$W7pFWxEOg3PWwmNn8@OhpypN^$%`=6><(8>xno_onmNxd@K-Xw;><0?^(Df8?qYJYixdVz5MaS z^`%1nX2tf8F6~|7Y%yA$9EIAw}8TKnkp;~G?@5T)~CDGajngtJ+rr@b@D+b$;lg; z6pX>?>p(!tUcPJD6R&?4>aTfN_UYu-`*x>u45zqny?*fX?~SwW``UcE@=Bp8wSA$> zo%YGLERyvFDz@`g=j;<{>taP^#<&p9=|YvX{ICKArP%w(g_L5tkb8&$pXgS2ln9TZ1Wf5z*6?udP>;tti_#wXRHeeh5E$k^?0_ oj>!QmY|OwA1jbo|1cTdU{vBqSJ7bkEJ_Py4)78&qol`;+00StBq5uE@ delta 873 zcmX@keUf{^lzIhE7srr_TW{~4_ZCT%Iq>j(jy8*4g~k-UxLq!Rn)h5ToGyE7e_?j1 zK6g{pbq5XoyJr?3?~~nC;k6-HVCC|E%~mQp9vo9A3w&WN<6cu)W`+>P_%`$+fO_zf_GsDv0N+%s+l@_SQ3=H>I!o?T^Tu znow3O@4eBJ`*pgPVL!L~##Qnva!)=LnKvz!u?^bDGWi0Fn5IGm!|}kaEG4I>{_ME9 zb4#+!we(5nlMjY*i9HRs7B{q+XAx1oTkKY})8qwAVwMZMt?XtM|K9Lly*xtm`17BY zWxW4{bbh@5mM!?6eKOy~qwTrex)C4V$N9Ug@l%&wB;=hewrkHHUhc{3nWU^6iaviZ zj@`Ut<4oDwNRF69#wJ#v^-ZiCVhst59AaShhxEDcOY&`A{60B1>yG|$JyZ5MD<5!y z^lMJu&BSj74u^&ga1e0+T@@`GXMXhBkC-=~S6M#TqqQSzceDBOdE&oZ?Q09~o@-2~ zE&ums%2YL4hri^C04uop(j5T~e9e+XL-i zXFi!6y)&o}*%;qlVLzkf z!Q6=xzij@!A-R3wmxEQdf*Y;omOS`4`}^hd>ns!64}#N{B-25r$%d@;k_<1r?=x&z Wl(|zgW8DFe^F3YtT-G@yGywogSA4Pn diff --git a/test-references/io/sf/carte/echosvg/svggen/rendering/FontDecoration.png b/test-references/io/sf/carte/echosvg/svggen/rendering/FontDecoration.png index c0c1a1fcc49d4954e73ed932dc644cb6afd8bc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huv`ScT>^)6quWXUQCda-D%lR?|+f|~k8qlr!DDv7QTL4{zxc zyMI)=rk@FSo>Nn|Y@(aX&yO$ktbN)gZbqpqWjcYEA?oct@LmWHdn)om|>k}lm>)8krloaYO3M-B}FM$3LKi#bAWgLm$ts<|#$ zxp_Bs=B~r)Txx1s&&AVrwY9CsPoK+q>3^%-q%O?@dYZ6u~YsbVQXF6 z$*<+O3p9tgu^%@OUsqSRA?R{>Ho9|Or2p3X37xf%*VHeYmbta4=;FS2+;Pv_do6=h z>IEs?H^PMnYwMO(cc=0JpZI_!J%67i5=_1sMv3_ac_R*#sPt5p*2f#`-pPj1 z{95kpzRMShsOANEc_SuAt?FZ~n$mVxFQt~4sH#vd8`J8h!uU8_sjM5_3QRV#rj&;c-CGQREM>*3iC!b>!|*%@2i8fG2clws?*}}_*d0^K+KF)#_6kPgg zts^~-JMN^v@6LGG=+T$t_`Y{gwAtG#+1G2`t)h$K@xz<4%mJQf->a#)i@|mP0LZXJ zVg5+I_qGQZrE8PPhLzL=@ZolQ(A`?aZ$j;fC%}0Bq876e75V{_AOQ;)V2A$)*0z#d THXpDU00000NkvXXu0mjfdSJJq diff --git a/test-references/samples/canvg/issue320.png b/test-references/samples/canvg/issue320.png index 6c76d3afd8abfffea9a4bbaa93742d8f7fe9b58b..65f66d7720e0fbc5f3a314adc37ec98f9b499168 100644 GIT binary patch delta 10792 zcmW++cRbtQ_tq+{TCKKPYPMz-pCW2g)U4RFW)~r`gV^s@V^!@@d+*uSo+(wMM65{d z5yU7#5IaBL-~HqMan2p*o_p?jJzf@Pg!D=u7$HCGF@1jUT$RXs1IiNbIt!US+iFV4oS5(? zZnaV7NEw0?EiE;YaBqEaUaE_tV$0SksuFD)|DWw3oSFa4gNAGOrbFH7WAR8nr+CtI zvNq6|W_g9dMeV*1=5B%;PeTemcMU#*TYLi`8sLs+p2Jq7L2)?=9P?nF*LVikci={CC zPy8! zYhHV)gk6cdpX2r7d`TX3Tg-gFPU)u+jjWHxVm7}A74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M60__s-8%N5YJQLQ_D5L@W%Ct90JyKov Qe7wuv#@YI@rC-v20NPEQ)&Kwi diff --git a/test-references/samples/tests/spec/scripting/domSVGColor.png b/test-references/samples/tests/spec/scripting/domSVGColor.png index 428697d1d7804f04c805df47402b45d0b8cb98a8..63bfc7d045683ebf6ca31d486a57426561a78622 100644 GIT binary patch literal 35278 zcmd42Wl&si*XBzSg1b8*1PKkHafjdpw=~kYySoN!+yaeD@Q~mTEVwl^F2UX1U5EUi zd1l`8zB4svs?LW~UAw!s)b6T%-}heY`mJk)D=SK4qLHB?ARu6Vl95nFKzPydyq%*U zJs&9(V7Ykyd1EZ2s(^stMUQ~+B^UwW_W974Z3F~YAOga!0RjSl3IYPLLq?;D;PVMY zb5R9R1cb^MpF5R==lvJXs?uTzWkVD@&pSv)a?%nAPk%q(nv4FPMs<+Uaz;SF>iWCA zfC8|{pZ^ZwlZ2?c$LxM4YQ5s;yQe7?2)krq9L*=^oP5#vu@co{eOWSfFExAFgk*~m zL8j=jZ=NGRlOvE4>2vUCB06!|P0>gn_q-2|9!2(;y+wwFhvJ-lM5bKzxAq_Q4G(@z zH6OYzSs(n0!WBcI3C8*V#g~L(bx_sEFud*<(5{x2sp+`e`Mdzw(y$-`D#?WOwp^B0 z7HgvzJ#XhHrsD`F!^70CUZmakvyf1WXEd)^)2M8-hClo)pHH ze}8#uwc0r1ypq(8tyaw>+|>Z}jMP(@nxc%aRhL6I?|rMQ{iy*A+Li{UnB_OcQ0lj3 zDx>fn&}E(Kj4bz&2tW2sb0~BNl%|=gB6D<(1K=u&nwEkKjh($%vL*#QnVTm5cts;# z|3KF9VaQF0EW$p+mmF;b=dmA-Pa0!sx?u^>cM#}@i__8Y2zBM*ofPPCFQ;EZ<6;bm-qs1HvxP1CR}Hh>y@vjF!4*;P8_Kv6+RU@e1< zyfEjZD%C!C|9shix0}JE(%Ns{KX7pn)@78TH(>be!N<(B8Oo6=;tfvyg$b=bn>HX( zkujw&pSLtEfmSz5h2gLV&(R!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zbz1quN+K{-8sh8~5VqC=W4AOkH!Med5$5SOz;;XIBeAz6BV<7;PK`KdTnfurq8qnl zjY;*w_|B8qwBpxFx(n)iPVeh!m-=8H@YfB_88^KuE27(5{?BEBm>5jJbzIPSEItTK xWZ1n!Tm*hff%zN-G|m05QPux@E4UbMNZ|Ry3I6lf%(qvstf;O~F84O%e*uz>ZC?NY diff --git a/test-references/samples/tests/spec/scripting/paintType.png b/test-references/samples/tests/spec/scripting/paintType.png index 6c8ccb9f33918ee48daf74118eb96578fbc4297f..72e7c98d6dc052702417df3fb6d8242951225362 100644 GIT binary patch delta 10936 zcmZviXH-*5*zeV2!GZ`%6cjirO(38MA|*k()BvHkAc!DUkWfO|M+7OMNCy>=PC|+F zA^`;>oe=3YN)bpP7+QcpxSVs>yYBnp?hkvfnf=T&Gkfhd^ZWnTOt`(af1C5fWO%oO zUTs_$b?!vismicvi%-`z^vWuqIH(c0#9i|oqRzRl+>6;th_QWLNvOESO&I$WcI%qG ztb>X==Ud^G!;t%}%#~j#=V#9TuWYxOfdK-3zx%TqUoL*w$bL!7YP^}uDGLYwA(V4| zK8ChDk1hwBRb{l%9`RKs5)?pW>t08H8F#0ZFa@v6=svX4vkbxqg@#pYE2aE5MHqq? zI2)mdt8FIWK|tM3$s6L9IQrtLG+1>&@SU~EIB?zLX+|NT6jXh#tiFyA3bF-1vkrEl zM-euM=0>WW)Vny6CTDe!#w>2g zj268fV^i*W@3!OhizAM|uRad%S$-Kfn-kgtAu!OYT&gWr-vpQ+WuBT{( zX8rr6kbQk^TC)o2~_2=U+u5>e7xPhQyHdO&dd{&OZkN1 z(p?s-Eb*y_aGU;+(XF##>J72$%U>@K-|aJNw*=}mI9eoEO zNU_|A2Uyr@>QY?n!NG;f237We0T)6Jz<~~tuyQ@QK!oT{j*|1<6ON(1WQ?1NIzuJl ze;uUEn7ezSr)$@O1=j{ka$H++JU;Nm*Qwteroo{CKJfH8u%}6J@fE1_XG`X+D>@gH z?8{VwECQc~6qGGLU_4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Uw3&JBQdvo1R z6Rm7zsQToodmJiuLYfd*NQF|pfcj8}-ezNG`7KWK^56PI;U|!T{kp3pmu%DX>13)9 zxPHD690upq=sKGR-jvOprRQ{%eL3yCU2UM`o)TL_zrZ5~d8)#g+u4;e!L^G|zBk%T zG_|VfxXlD9NmeywCZq&fW9R0n2p-`re8-j9j+!MI9?8>PHW(q-2`O;^v88M02H$R6 z$lfrx1ZD0!j$Q?{<&yu^&e$#lh!%3hY$W=hjggmLGII&WTgdC2 zD(!8A&_ezdz`lj?(Et~hmU4PgqHoNQ6|x=}Qt^CP!&RkFsK2SvwwxJ77?SVI3xtIr~CtCU(0%bIv4!CJOG0STn)wX`@;v2_E9jG^MO$_ z(0Q+Q;trblwzjG}R;Vr84(OoM(BI4i!2+)AvViU!`mn&1z%+>;lb ziU*ypBraeODUg#GXK_|ld#e0M1kO5QvibByT&siHa<2z&DNHvVVs;IGgd*rkz5tW& z={K84W&S*jq$K@_y1`L2v$(Fp=NY@mkA1gVY~63K&3;Bp&1EeME-nuj4V`d&IrOlK zyG=swJa#=42Y5o4g%&gRKE(n=|H@Y>Ij*efAfO@NAzO&*&NLYFys=T556+{k2I;d- z%o=2G>~>8L>0GQ_3i~i}E_=Br)JOa0kDpQ4D=riHG@s+h1;FBwt&&;T9}WLj$vMB2 zZppcO*#zG;s_QA{uY8L;`)Yh@(KS)O=xXzlof>9};$>gB7Y3C3#qn^1Gs1sxx}hkr z++EPG>T^{hYx!E*Ag(Q+)ft{|Hm{B;6S+eP*%=$#@4@1m%gj1`Ua^BI_`}kDI~5Op l7buE9fB4j8v*rE6%WZXEH&0u+{D;(ZGz`>BA3c8kzW~fG&fEY1 diff --git a/test-resources/io/sf/carte/echosvg/css/dom/bug11670.svg b/test-resources/io/sf/carte/echosvg/css/dom/bug11670.svg index f7e8e7985..76ee42cab 100644 --- a/test-resources/io/sf/carte/echosvg/css/dom/bug11670.svg +++ b/test-resources/io/sf/carte/echosvg/css/dom/bug11670.svg @@ -64,15 +64,15 @@ return; } - var val = style.getPropertyCSSValue("fill"); + var val = style.getCSSStyleValue("fill"); if ( val == null ){ result.setAttributeNS(null, "errorCode", - "CSSStyleDeclaration.getPropertyCSSValue returned null"); + "CSSStyleDeclaration.getCSSStyleValue returned null"); return; } - val = val.getRGBColor() + val = val.getColorValue() if (val.red.getFloatValue(1) != 2 || val.green.getFloatValue(1) != 3 || diff --git a/test-resources/io/sf/carte/echosvg/css/dom/bug9740.svg b/test-resources/io/sf/carte/echosvg/css/dom/bug9740.svg index 403912392..dabf6ff7b 100644 --- a/test-resources/io/sf/carte/echosvg/css/dom/bug9740.svg +++ b/test-resources/io/sf/carte/echosvg/css/dom/bug9740.svg @@ -65,18 +65,18 @@ return; } - var val = style.getPropertyCSSValue("fill"); + var val = style.getCSSStyleValue("fill"); if ( val == null ){ - result.setAttributeNS(null, "errorCode", "CSSStyleDeclaration.getPropertyCSSValue returned null"); + result.setAttributeNS(null, "errorCode", "CSSStyleDeclaration.getCSSStyleValue returned null"); return; } - val = val.getRGBColor() + val = val.getColorValue() - if (val.red.getFloatValue(1) != 255 || - val.green.getFloatValue(1) != 0 || - val.blue.getFloatValue(1) != 0) { + if (val.red.getValue() != 255 || + val.green.getValue() != 0 || + val.blue.getValue() != 0) { result.setAttributeNS(null, "errorCode", "invalid color components"); return; } diff --git a/test-resources/io/sf/carte/echosvg/css/dom/rgbPresentationTest.svg b/test-resources/io/sf/carte/echosvg/css/dom/rgbPresentationTest.svg index 55877b98b..9aab14ef0 100644 --- a/test-resources/io/sf/carte/echosvg/css/dom/rgbPresentationTest.svg +++ b/test-resources/io/sf/carte/echosvg/css/dom/rgbPresentationTest.svg @@ -57,14 +57,14 @@ return } - var val = elt.getPresentationAttribute("fill") + var val = elt.getPresentationAttributeValue("fill") if (val == null) { result.setAttributeNS(null, "errorCode", "CSSStyleDeclaration.getPropertyCSSValue returned null") return } - var rgb = val.getRGBColor() + var rgb = val.getColorValue(); if (rgb.red.cssText != "1"){ result.setAttributeNS(null, "errorCode", "invalid red component"); diff --git a/test-resources/io/sf/carte/echosvg/css/dom/rgbTest.svg b/test-resources/io/sf/carte/echosvg/css/dom/rgbTest.svg index a04490c9b..2ac9c3e58 100644 --- a/test-resources/io/sf/carte/echosvg/css/dom/rgbTest.svg +++ b/test-resources/io/sf/carte/echosvg/css/dom/rgbTest.svg @@ -63,14 +63,14 @@ return; } - var val = decl.getPropertyCSSValue("fill"); + var val = decl.getCSSStyleValue("fill"); if ( val == null ){ - result.setAttributeNS(null, "errorCode", "CSSStyleDeclaration.getPropertyCSSValue returned null"); + result.setAttributeNS(null, "errorCode", "CSSStyleDeclaration.getCSSStyleValue returned null"); return; } - val = val.getRGBColor() + val = val.getColorValue() if (val.red.cssText != "1"){ result.setAttributeNS(null, "errorCode", "invalid red component"); diff --git a/test-resources/io/sf/carte/echosvg/css/dom/rgbUpdateTest.svg b/test-resources/io/sf/carte/echosvg/css/dom/rgbUpdateTest.svg index aa0f9e9ec..6433b15e3 100644 --- a/test-resources/io/sf/carte/echosvg/css/dom/rgbUpdateTest.svg +++ b/test-resources/io/sf/carte/echosvg/css/dom/rgbUpdateTest.svg @@ -64,14 +64,14 @@ return } - var val = decl.getPropertyCSSValue("fill") + var val = decl.getCSSStyleValue("fill") if (val == null) { result.setAttributeNS(null, "errorCode", "CSSStyleDeclaration.getPropertyCSSValue returned null") return } - val = val.getRGBColor() + val = val.getColorValue() val.red.cssText = 4 @@ -88,7 +88,7 @@ return } - val = decl.getPropertyCSSValue("fill") + val = decl.getCSSStyleValue("fill") val.cssText = "#050607"