From 88735768b9a0c4f41a5f8ed32c5c71c9d162c2b9 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 8 Jan 2015 20:19:58 +0100 Subject: remove nonvalidating css in w3 mode --- itjs.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/itjs.php b/itjs.php index 60d1e87..35b3c80 100644 --- a/itjs.php +++ b/itjs.php @@ -48,15 +48,18 @@ else if (it::match('\.css', $file)) $data .= "\n#it_boot_dom { display:none }\n"; # Append magic style for it_boot if (!it::match('^devel', $GLOBALS['ULTRASERVERTYPE'])) $data = it::replace(array('[ \t]*([{};])[ \t]*' => '$1', '/\*.*?\*/' => ""), $data); - if (it::match('W3C_CSS_Validator', $_SERVER['HTTP_USER_AGENT']) || EDC('w3c')) + if (it::match('W3C_CSS_Validator', $_SERVER['HTTP_USER_AGENT']) || $_GET['w3c']) $data = it::replace(array( - '@-.*' => "", + '@-.*|@page.*' => "", 'background[^;}]*(gradient|rgba)[^;}]*;?' => "", - '(filter:\s*(progid|none)|text-overflow:|zoom:|-webkit-|display:-moz-|-moz-|-o-|cursor:|border-radius:|behavior:|\w+:expression)[^;}]*;?' => "", + '::-webkit[^ ,{]*' => '.foo', + '\n:.*' => "\n", + '(filter:\s*(progid|none)|text-overflow:|zoom:|-webkit-[-\w]:|display:-moz-|-moz-|-o-|cursor:|border-radius:|behavior:|text-rendering:|\w+:expression:|[-\w]*appearance:)[^;}]*;?' => "", 'pointer-events:[^;}]*' => "", 'html\.ie6.*' => "", ':valid:' => ":", # hack for iOS datetime - '([^/])\*(\w)' => '$1$2'), + '([^/])\*(\w)' => '$1$2', + ), $data ); if ((($ie = it::match('MSIE (\d+)', $_SERVER['HTTP_USER_AGENT'])) && intval($ie) < 9) || EDC('iecompat')) -- cgit v1.2.3