Skip to content

Commit

Permalink
css: rename css.engine.value.css2 package to css.engine.value.css
Browse files Browse the repository at this point in the history
CSS as a whole isn't versioned anymore, and keeping a css2 package would only create confusion.
  • Loading branch information
carlosame committed Oct 12, 2024
1 parent d4870ff commit 5f71fd5
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 74 deletions.
3 changes: 3 additions & 0 deletions MIGRATING_FROM_BATIK.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ Batik:

12) The line-height property now has a global default of 1.1, instead of the
mixture of 1.1 and 1 that Batik uses.

13) The `css.engine.value.css2` package was renamed to `css.engine.value.css`,
given that CSS as a whole isn't versioned anymore.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public static Float convertFontStretch(Element e) {
public static Float convertFontWeight(Element e) {
Value v = CSSUtilities.getComputedStyle(e, SVGCSSEngine.FONT_WEIGHT_INDEX);
int weight = (int) v.getFloatValue();
// Note: the mapping from CSS2 to TextAttribute's weights is somewhat arbitrary.
// Note: the mapping from CSS to TextAttribute's weights is somewhat arbitrary.
// Important is to map 400/normal to REGULAR and 700/bold to BOLD.
switch (weight) {
case 100:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@
import io.sf.carte.echosvg.css.engine.value.ShorthandManager;
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.css2.ClipManager;
import io.sf.carte.echosvg.css.engine.value.css2.CursorManager;
import io.sf.carte.echosvg.css.engine.value.css2.DirectionManager;
import io.sf.carte.echosvg.css.engine.value.css2.DisplayManager;
import io.sf.carte.echosvg.css.engine.value.css2.FontFamilyManager;
import io.sf.carte.echosvg.css.engine.value.css2.FontShorthandManager;
import io.sf.carte.echosvg.css.engine.value.css2.FontSizeAdjustManager;
import io.sf.carte.echosvg.css.engine.value.css2.FontSizeManager;
import io.sf.carte.echosvg.css.engine.value.css2.FontStretchManager;
import io.sf.carte.echosvg.css.engine.value.css2.FontStyleManager;
import io.sf.carte.echosvg.css.engine.value.css2.FontVariantManager;
import io.sf.carte.echosvg.css.engine.value.css2.FontWeightManager;
import io.sf.carte.echosvg.css.engine.value.css2.LineHeightManager;
import io.sf.carte.echosvg.css.engine.value.css2.MarginShorthandManager;
import io.sf.carte.echosvg.css.engine.value.css2.OverflowManager;
import io.sf.carte.echosvg.css.engine.value.css2.SrcManager;
import io.sf.carte.echosvg.css.engine.value.css2.TextDecorationManager;
import io.sf.carte.echosvg.css.engine.value.css2.UnicodeBidiManager;
import io.sf.carte.echosvg.css.engine.value.css2.VisibilityManager;
import io.sf.carte.echosvg.css.engine.value.css.ClipManager;
import io.sf.carte.echosvg.css.engine.value.css.CursorManager;
import io.sf.carte.echosvg.css.engine.value.css.DirectionManager;
import io.sf.carte.echosvg.css.engine.value.css.DisplayManager;
import io.sf.carte.echosvg.css.engine.value.css.FontFamilyManager;
import io.sf.carte.echosvg.css.engine.value.css.FontShorthandManager;
import io.sf.carte.echosvg.css.engine.value.css.FontSizeAdjustManager;
import io.sf.carte.echosvg.css.engine.value.css.FontSizeManager;
import io.sf.carte.echosvg.css.engine.value.css.FontStretchManager;
import io.sf.carte.echosvg.css.engine.value.css.FontStyleManager;
import io.sf.carte.echosvg.css.engine.value.css.FontVariantManager;
import io.sf.carte.echosvg.css.engine.value.css.FontWeightManager;
import io.sf.carte.echosvg.css.engine.value.css.LineHeightManager;
import io.sf.carte.echosvg.css.engine.value.css.MarginShorthandManager;
import io.sf.carte.echosvg.css.engine.value.css.OverflowManager;
import io.sf.carte.echosvg.css.engine.value.css.SrcManager;
import io.sf.carte.echosvg.css.engine.value.css.TextDecorationManager;
import io.sf.carte.echosvg.css.engine.value.css.UnicodeBidiManager;
import io.sf.carte.echosvg.css.engine.value.css.VisibilityManager;
import io.sf.carte.echosvg.css.engine.value.svg.AlignmentBaselineManager;
import io.sf.carte.echosvg.css.engine.value.svg.BaselineShiftManager;
import io.sf.carte.echosvg.css.engine.value.svg.ClipPathManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import org.w3c.dom.DOMException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import io.sf.carte.echosvg.css.engine.value.IdentifierManager;
import io.sf.carte.echosvg.css.engine.value.StringMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import io.sf.carte.echosvg.css.engine.value.IdentifierManager;
import io.sf.carte.echosvg.css.engine.value.StringMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import java.io.IOException;
import java.io.StringReader;
Expand Down Expand Up @@ -53,7 +53,7 @@
import io.sf.carte.echosvg.util.CSSConstants;

/**
* This class provides support for the CSS2 'font' shorthand property.
* This class provides support for the CSS 'font' shorthand property.
*
* The form of this property is: [ [ <font-style> || <font-variant>
* || <font-weight> ]? <font-size> [ / <line-height> ]?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import org.w3c.css.om.unit.CSSUnit;
import org.w3c.dom.DOMException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import io.sf.carte.doc.style.css.CSSValue.Type;
import io.sf.carte.echosvg.css.engine.CSSEngine;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import io.sf.carte.echosvg.css.engine.value.IdentifierManager;
import io.sf.carte.echosvg.css.engine.value.StringMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import io.sf.carte.echosvg.css.engine.value.IdentifierManager;
import io.sf.carte.echosvg.css.engine.value.StringMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import org.w3c.css.om.unit.CSSUnit;
import org.w3c.dom.DOMException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import org.w3c.dom.DOMException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import io.sf.carte.echosvg.css.engine.value.IdentifierManager;
import io.sf.carte.echosvg.css.engine.value.StringMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
limitations under the License.
*/
package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import io.sf.carte.echosvg.css.engine.value.IdentifierManager;
import io.sf.carte.echosvg.css.engine.value.StringMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

package io.sf.carte.echosvg.css.engine.value.css2;
package io.sf.carte.echosvg.css.engine.value.css;

import io.sf.carte.echosvg.css.engine.value.IdentifierManager;
import io.sf.carte.echosvg.css.engine.value.StringMap;
Expand Down
2 changes: 1 addition & 1 deletion echosvg-css/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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.css;
exports io.sf.carte.echosvg.css.engine.value.svg;
exports io.sf.carte.echosvg.css.dom;
exports io.sf.carte.echosvg.css.engine.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public void test() throws Exception {
testPropertyManager("io.sf.carte.echosvg.css.engine.value.svg.BaselineShiftManager", false, "baseline",
"baseline | sub | super");

// css.engine.value.css2.clip
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.ClipManager", false, "auto", "auto");
// css.engine.value.css.clip
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.ClipManager", false, "auto", "auto");

// css.engine.value.svg.clip-path
testPropertyManager("io.sf.carte.echosvg.css.engine.value.svg.ClipPathManager", false, "none", "none");
Expand Down Expand Up @@ -88,15 +88,15 @@ public void test() throws Exception {
testPropertyManager("io.sf.carte.echosvg.css.engine.value.svg.ColorRenderingManager", true, "auto",
"auto | optimizeSpeed | optimizeQuality");

// css.engine.value.css2.cursor
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.CursorManager", true, "auto",
// css.engine.value.css.cursor
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.CursorManager", true, "auto",
"auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ");

// css.engine.value.css2.direction
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.DirectionManager", true, "ltr", "ltr | rtl");
// css.engine.value.css.direction
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.DirectionManager", true, "ltr", "ltr | rtl");

// css.engine.value.css2.display
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.DisplayManager", false, "inline",
// css.engine.value.css.display
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.DisplayManager", false, "inline",
"inline | block | list-item | run-in | compact | marker | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none");

// css.engine.value.svg.dominant-baseline
Expand Down Expand Up @@ -131,33 +131,33 @@ public void test() throws Exception {
"");

// IGNORE
// css.engine.value.css2.font
// testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.FontManager",
// css.engine.value.css.font
// testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.FontManager",
// true, "1", "");

// css.engine.value.css2.font-family
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.FontFamilyManager", true, "__USER_AGENT__", "");
// css.engine.value.css.font-family
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.FontFamilyManager", true, "__USER_AGENT__", "");

// css.engine.value.css2.font-size
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.FontSizeManager", true, "medium", "medium");
// css.engine.value.css.font-size
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.FontSizeManager", true, "medium", "medium");

// css.engine.value.css2.font-size-adjust
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.FontSizeAdjustManager", true, "none", "none");
// css.engine.value.css.font-size-adjust
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.FontSizeAdjustManager", true, "none", "none");

// css.engine.value.css2.font-stretch
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.FontStretchManager", true, "normal",
// css.engine.value.css.font-stretch
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.FontStretchManager", true, "normal",
"normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded");

// css.engine.value.css2.font-style
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.FontStyleManager", true, "normal",
// css.engine.value.css.font-style
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.FontStyleManager", true, "normal",
"normal | italic | oblique");

// css.engine.value.css2.font-variant
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.FontVariantManager", true, "normal",
// css.engine.value.css.font-variant
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.FontVariantManager", true, "normal",
"normal | small-caps");

// css.engine.value.css2.font-weigth
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.FontWeightManager", true, "normal",
// css.engine.value.css.font-weigth
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.FontWeightManager", true, "normal",
"normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900");

// css.engine.value.svg.glyph-orientation-horizontal
Expand Down Expand Up @@ -207,8 +207,8 @@ public void test() throws Exception {
testPropertyManager("io.sf.carte.echosvg.css.engine.value.PropertyManagerTest$DefaultOpacityManager", false,
"1", "");

// css.engine.value.css2.overflow
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.OverflowManager", false, "visible",
// css.engine.value.css.overflow
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.OverflowManager", false, "visible",
"visible | hidden | scroll | auto");

// css.engine.value.svg.pointer-events
Expand Down Expand Up @@ -260,26 +260,26 @@ public void test() throws Exception {
"start | middle | end");

// css.engine.value.svg.text-decoration
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.TextDecorationManager", false, "none",
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.TextDecorationManager", false, "none",
"none | underline | overline | line-through | blink");

// css.engine.value.svg.text-rendering
testPropertyManager("io.sf.carte.echosvg.css.engine.value.svg.TextRenderingManager", true, "auto",
"auto | optimizeSpeed | optimizeLegibility | geometricPrecision");

// css.engine.value.svg.unicode-bidi
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.UnicodeBidiManager", false, "normal",
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.UnicodeBidiManager", false, "normal",
"normal | embed | bidi-override");

// css.engine.value.css2.visibility
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css2.VisibilityManager", true, "visible",
// css.engine.value.css.visibility
testPropertyManager("io.sf.carte.echosvg.css.engine.value.css.VisibilityManager", true, "visible",
"visible | hidden | collapse");

// css.engine.value.css2.word-spacing
// css.engine.value.css.word-spacing
testPropertyManager("io.sf.carte.echosvg.css.engine.value.PropertyManagerTest$WordSpacingManager", true,
"normal", "normal");

// css.engine.value.css2.writing-mode
// css.engine.value.css.writing-mode
testPropertyManager("io.sf.carte.echosvg.css.engine.value.svg.WritingModeManager", true, "lr-tb",
"lr-tb | rl-tb | tb-rl | lr | rl | tb");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class SVGCSSStyler implements SVGSyntax {
/**
* Invoking this method removes all the styling attributes (such as 'fill' or
* 'fill-opacity') from the input element and its descendant and replaces them
* with their CSS2 property counterparts.
* with their CSS property counterparts.
*
* @param node SVG Node to be converted to use style
*/
Expand Down

0 comments on commit 5f71fd5

Please sign in to comment.