Merge "CSSJanus: Support text-shadow and box-shadow flipping"
[lhc/web/wiklou.git] / tests / phpunit / includes / libs / CSSJanusTest.php
index e6432a9..1c898f0 100644 (file)
@@ -137,10 +137,15 @@ class CSSJanusTest extends MediaWikiTestCase {
                                '.foo { padding: 1px inherit 3px auto; }',
                                '.foo { padding: 1px auto 3px inherit; }'
                        ),
+                       // border-radius assigns different meanings to the values
                        array(
                                '.foo { border-radius: .25em 15px 0pt 0ex; }',
-                               '.foo { border-radius: .25em 0ex 0pt 15px; }'
+                               '.foo { border-radius: 15px .25em 0ex 0pt; }'
                        ),
+                       array(
+                               '.foo { border-radius: 0px 0px 5px 5px; }',
+                       ),
+                       // Ensure the rule doesn't break other stuff
                        array(
                                '.foo { x-unknown: a b c d; }'
                        ),
@@ -191,6 +196,28 @@ class CSSJanusTest extends MediaWikiTestCase {
                                '.foo { padding: 1px; }'
                        ),
 
+                       // text-shadow and box-shadow
+                       array(
+                               '.foo { box-shadow: -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+                               '.foo { box-shadow: 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+                       ),
+                       array(
+                               '.foo { box-shadow: inset -6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+                               '.foo { box-shadow: inset 6px 3px 8px 5px rgba(0, 0, 0, 0.25); }',
+                       ),
+                       array(
+                               '.foo { text-shadow: orange 2px 0; }',
+                               '.foo { text-shadow: orange -2px 0; }',
+                       ),
+                       array(
+                               '.foo { text-shadow: 2px 0 orange; }',
+                               '.foo { text-shadow: -2px 0 orange; }',
+                       ),
+                       array(
+                               // Don't mangle zeroes
+                               '.foo { text-shadow: orange 0 2px; }'
+                       ),
+
                        // Direction
                        // Note: This differs from the Python implementation,
                        // see also CSSJanus::fixDirection for more info.
@@ -388,6 +415,11 @@ class CSSJanusTest extends MediaWikiTestCase {
                                '/* @noflip */ div { float: left; } .foo { float: left; }',
                                '/* @noflip */ div { float: left; } .foo { float: right; }'
                        ),
+                       array(
+                               // support parentheses in selector
+                               '/* @noflip */ .test:not(:first) { margin-right: -0.25em; margin-left: 0.25em; }',
+                               '/* @noflip */ .test:not(:first) { margin-right: -0.25em; margin-left: 0.25em; }'
+                       ),
                        array(
                                // after multiple rules
                                '.foo { float: left; } /* @noflip */ div { float: left; }',