Skip to content

Commit 56f04c2

Browse files
author
Onno van der Zee
committed
glyph-orientation and text-anchor on svg texts
1 parent c92c95e commit 56f04c2

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

src/css/Properties.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ var Properties = {
323323
"font-weight" : "normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit",
324324

325325
//G
326+
"glyph-orientation-horizontal" : "<glyph-angle> | inherit",
327+
"glyph-orientation-vertical" : "auto | <glyph-angle> | inherit",
326328
"grid" : 1,
327329
"grid-area" : 1,
328330
"grid-auto-columns" : 1,
@@ -492,6 +494,7 @@ var Properties = {
492494
"target-name" : 1,
493495
"target-new" : 1,
494496
"target-position" : 1,
497+
"text-anchor" : "start | middle | end | inherit",
495498
"text-align" : "left | right | center | justify | match-parent | start | end | inherit" ,
496499
"text-align-last" : 1,
497500
"text-decoration" : 1,

src/css/ValidationTypes.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ var ValidationTypes = {
148148
return part.type == "angle";
149149
},
150150

151+
"<glyph-angle>": function(part){
152+
return part.type == "angle" && part.units == 'deg';
153+
},
154+
151155
"<uri>": function(part){
152156
return part.type == "uri";
153157
},

tests/css/Validation.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,57 @@
809809
}));
810810
});
811811

812+
suite.add(new ValidationTestCase({
813+
property: "glyph-orientation-horizontal",
814+
815+
valid: [
816+
"-43deg",
817+
".7deg",
818+
"90deg",
819+
"521deg",
820+
"inherit"
821+
],
822+
823+
invalid: {
824+
"auto" : "Expected (<glyph-angle> | inherit) but found 'auto'.",
825+
"70rad" : "Expected (<glyph-angle> | inherit) but found '70rad'.",
826+
"4grad" : "Expected (<glyph-angle> | inherit) but found '4grad'."
827+
}
828+
}));
829+
830+
suite.add(new ValidationTestCase({
831+
property: "glyph-orientation-vertical",
832+
833+
valid: [
834+
"auto",
835+
"-43deg",
836+
".7deg",
837+
"90deg",
838+
"521deg",
839+
"inherit"
840+
],
841+
842+
invalid: {
843+
"70rad" : "Expected (<glyph-angle> | inherit) but found '70rad'.",
844+
"4grad" : "Expected (<glyph-angle> | inherit) but found '4grad'."
845+
}
846+
}));
847+
848+
suite.add(new ValidationTestCase({
849+
property: "text-anchor",
850+
851+
valid: [
852+
"start",
853+
"middle",
854+
"end",
855+
"inherit"
856+
],
857+
858+
invalid: {
859+
"foo" : "Expected (start | middle | end | inherit) but found 'foo'."
860+
}
861+
}));
862+
812863
suite.add(new ValidationTestCase({
813864
property: "text-align",
814865

0 commit comments

Comments
 (0)