From 33ff4c19ea597833ac2086ccdc98cfb7263d00de Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Thu, 15 Dec 2016 16:10:55 +0900 Subject: [PATCH] Add svg2.vim With inline SVG, some SVG elements and attributes appear in CSS. So I need to support it. SVG attributes that can be used in CSS are defined in [presentational attributes][1]. All SVG elements can appear. [1]: http://www.w3.org/TR/SVG2/styling.html#PresentationAttributes --- after/syntax/css/svg2.vim | 23 +++++++++ after/syntax/html.vim | 1 + test/test.css | 103 +++++++++++++++++++++++++++++++++++++ test/test.html | 104 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 231 insertions(+) create mode 100644 after/syntax/css/svg2.vim diff --git a/after/syntax/css/svg2.vim b/after/syntax/css/svg2.vim new file mode 100644 index 0000000..4a605f6 --- /dev/null +++ b/after/syntax/css/svg2.vim @@ -0,0 +1,23 @@ +syn keyword cssTagName animate animateMotion animateTransform circle clipPath cursor defs desc discard ellipse feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence filter foreignObject g hatch hatchpath image line linearGradient marker mesh meshgradient meshpatch meshrow metadata mpath path pattern polygon polyline radialGradient rect set solidcolor stop switch symbol text textPath tspan unknown use view + +syn keyword cssFontProp contained cx cy d r rx ry x y +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" +syn match cssFontProp contained "\" + +syn keyword cssFontAttr contained arcs butt crispEdges geometricPrecision optimizeQuality painted stroke viewport visibleFill visiblePainted visibleStroke +syn match cssFontAttr contained "\" +syn match cssFontAttr contained "\" +syn match cssFontAttr contained "\" +syn match cssFontAttr contained "\" +syn match cssFontAttr contained "\" + +syn region cssFunction contained matchgroup=cssFunctionName start="\<\(child\|icc-color\)\s*(" end=")" oneline keepend diff --git a/after/syntax/html.vim b/after/syntax/html.vim index f331592..0f4524e 100644 --- a/after/syntax/html.vim +++ b/after/syntax/html.vim @@ -65,5 +65,6 @@ syn include @htmlCss syntax/css/pointerevents.vim syn include @htmlCss syntax/css/selectors-nonelement-1.vim syn include @htmlCss syntax/css/selectors.vim syn include @htmlCss syntax/css/selectors4.vim +syn include @htmlCss syntax/css/svg2.vim syn include @htmlCss syntax/css/web-animations-1.vim syn include @htmlCss syntax/css/worklets-1.vim diff --git a/test/test.css b/test/test.css index 10f0e08..f7aaf7a 100644 --- a/test/test.css +++ b/test/test.css @@ -760,3 +760,106 @@ rtc, template { display: auto; } + +.svg2, +animate, +animateMotion, +animateTransform, +circle, +clipPath, +cursor, +defs, +desc, +discard, +ellipse, +feBlend, +feColorMatrix, +feComponentTransfer, +feComposite, +feConvolveMatrix, +feDiffuseLighting, +feDisplacementMap, +feDistantLight, +feDropShadow, +feFlood, +feFuncA, +feFuncB, +feFuncG, +feFuncR, +feGaussianBlur, +feImage, +feMerge, +feMergeNode, +feMorphology, +feOffset, +fePointLight, +feSpecularLighting, +feSpotLight, +feTile, +feTurbulence, +filter, +foreignObject, +g, +hatch, +hatchpath, +image, +line, +linearGradient, +marker, +mesh, +meshgradient, +meshpatch, +meshrow, +metadata, +mpath, +path, +pattern, +polygon, +polyline, +radialGradient, +rect, +set, +solidcolor, +stop, +switch, +symbol, +text, +textPath, +tspan, +unknown, +use, +view { + color-interpolation: arcs; + color-rendering: butt; + cx: crispEdges; + cy: geometricPrecision; + d: optimizeQuality; + fill-opacity: painted; + fill-rule: stroke; + fill: viewport; + image-rendering: visibleFill; + marker-end: visiblePainted; + marker-mid: visibleStroke; + marker-start: bounding-box; + pointer-events: context-fill; + r: context-stroke; + rx: fixed-position; + ry: miter; + shape-rendering: miter-clip; + solid-color: non-scaling-stroke; + solid-opacity: non-scaling-size; + stop-color: non-rotation; + stop-opacity: child(1); + stroke-dasharray: icc-color(foo); + stroke-dashoffset: auto; + stroke-linecap: auto; + stroke-linejoin: auto; + stroke-miterlimit: auto; + stroke-opacity: auto; + stroke-width: auto; + stroke: auto; + text-anchor: auto; + vector-effect: auto; + x: auto; + y: auto; +} diff --git a/test/test.html b/test/test.html index 681e70a..c9472e3 100644 --- a/test/test.html +++ b/test/test.html @@ -836,6 +836,110 @@ rtc, template { display: auto; } + +