Updated CSS highlighter to recognize CSS3
authorAlexander Ebert <ebert@woltlab.com>
Wed, 15 Mar 2017 16:30:56 +0000 (17:30 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 15 Mar 2017 16:30:56 +0000 (17:30 +0100)
See #2218

wcfsetup/install/files/lib/system/bbcode/highlighter/CssHighlighter.class.php

index dbe6a5af8a37b58aa7a86ad9f7941496430eae41..6f880bd9c04a3bbdcb04b0b60577791d0af6518e 100644 (file)
@@ -80,7 +80,17 @@ class CssHighlighter extends Highlighter {
                'align-content',
                'align-items',
                'align-self',
+               'animation',
+               'animation-delay',
+               'animation-direction',
+               'animation-duration',
+               'animation-fill-mode',
+               'animation-iteration-count',
+               'animation-name',
+               'animation-play-state',
+               'animation-timing-function',
                'azimuth',
+               'backface-visibility',
                'background',
                'background-attachment',
                'background-clip',
@@ -100,6 +110,12 @@ class CssHighlighter extends Highlighter {
                'border-bottom-width',
                'border-collapse',
                'border-color',
+               'border-image',
+               'border-image-outset',
+               'border-image-repeat',
+               'border-image-slice',
+               'border-image-source',
+               'border-image-width',
                'border-l@@eft',
                'border-left-color',
                'border-left-radius',
@@ -123,10 +139,21 @@ class CssHighlighter extends Highlighter {
                'border-width',
                'bottom',
                'box-shadow',
+               'box-sizing',
                'caption-side',
                'clear',
                'clip',
                'color',
+               'column-count',
+               'column-fill',
+               'column-gap',
+               'column-rule',
+               'column-rule-color',
+               'column-rule-style',
+               'column-rule-width',
+               'column-span',
+               'column-width',
+               'columns',
                'content',
                'counter-increment',
                'counter-reset',
@@ -140,15 +167,17 @@ class CssHighlighter extends Highlighter {
                'empty-cells',
                'flex',
                'flex-basis',
-               'flex-wrap',
                'flex-direction',
                'flex-flow',
                'flex-grow',
                'flex-shrink',
+               'flex-wrap',
                'float',
                'font',
                'font-family',
                'font-size',
+               'font-size-adjust',
+               'font-stretch',
                'font-style',
                'font-variant',
                'font-weight',
@@ -175,6 +204,7 @@ class CssHighlighter extends Highlighter {
                'orphans',
                'outline',
                'outline-color',
+               'outline-offset',
                'outline-style',
                'outline-width',
                'overflow',
@@ -191,11 +221,14 @@ class CssHighlighter extends Highlighter {
                'pause',
                'pause-after',
                'pause-before',
+               'perspective',
+               'perspective-origin',
                'pitch',
                'pitch-range',
                'play-during',
                'position',
                'quotes',
+               'resize',
                'richness',
                'r@@ight',
                'scrollbar-3dlight-color',
@@ -212,14 +245,28 @@ class CssHighlighter extends Highlighter {
                'speak-punctuation',
                'speech-rate',
                'stress',
+               'tab-size',
                'table-layout',
                'text-align',
+               'text-align-last',
                'text-decoration',
+               'text-decoration-color',
+               'text-decoration-line',
+               'text-decoration-style',
                'text-indent',
+               'text-justify',
                'text-overflow',
                'text-shadow',
                'text-transform',
                'top',
+               'transform',
+               'transform-origin',
+               'transform-style',
+               'transition',
+               'transition-delay',
+               'transition-duration',
+               'transition-property',
+               'transition-timing-function',
                'unicode-bidi',
                'vertical-align',
                'visibility',
@@ -228,12 +275,17 @@ class CssHighlighter extends Highlighter {
                'white-space',
                'widows',
                'width',
+               'word-break',
                'word-spacing',
                'word-wrap',
                'z-index',
                '!important',
+               '@charset',
+               '@font-face',
                '@import',
-               '@media'
+               '@keyframes',
+               '@media',
+               '@page'
        ];
        
        /**
@@ -478,7 +530,32 @@ class CssHighlighter extends Highlighter {
                'hsl',
                'hsla',
                'rgb',
-               'rgba'
+               'rgba',
+               'flex',
+               'inline-flex',
+               'initial',
+               'matrix',
+               'matrix3d',
+               'perspective',
+               'rotate',
+               'rotate3d',
+               'rotatex',
+               'rotatey',
+               'rotatez',
+               'scale',
+               'scale3d',
+               'scalex',
+               'scaley',
+               'scalez',
+               'skew',
+               'skwex',
+               'skewy',
+               'skewz',
+               'translate',
+               'translate3d',
+               'translatex',
+               'translatey',
+               'translatez'
        ];
        
        /**
@@ -487,16 +564,24 @@ class CssHighlighter extends Highlighter {
        protected $keywords3 = [
                'active',
                'after',
+               'any',
                'before',
                'checked',
+               'default',
+               'dir',
                'disabled',
                'empty',
                'enabled',
+               'first',
                'first-child',
                'first-letter',
                'first-line',
                'first-of-type',
                'focus',
+               'fullscreen',
+               'indeterminate',
+               'in-range',
+               'invalid',
                'lang',
                'last-child',
                'last-of-type',
@@ -505,12 +590,18 @@ class CssHighlighter extends Highlighter {
                'not',
                'nth-child',
                'nth-last-child',
-               'nth-of-type',
                'nth-last-of-type',
+               'nth-of-type',
                'only-child',
                'only-of-type',
+               'optional',
+               'out-of-range',
+               'read-only',
+               'read-write',
                'root',
+               'scope',
                'target',
+               'valid',
                'visited'
        ];