src
1 year ago
CHANGELOG.md
1 year ago
LICENSE
1 year ago
README.md
1 year ago
composer.json
1 year ago
CHANGELOG.md
301 lines
| 1 | # Changelog |
| 2 | |
| 3 | All notable changes to this project will be documented in this file. |
| 4 | This project adheres to [](https://semver.org/Semantic Versioning](https://semver.org/](https://semver.org/). |
| 5 | |
| 6 | ## x.y.z |
| 7 | |
| 8 | ### Added |
| 9 | |
| 10 | ### Changed |
| 11 | |
| 12 | ### Deprecated |
| 13 | |
| 14 | ### Removed |
| 15 | |
| 16 | ### Fixed |
| 17 | |
| 18 | ## 8.6.0 |
| 19 | |
| 20 | ### Added |
| 21 | - Support arithmetic operators in CSS function arguments (#607) |
| 22 | - Add support for inserting an item in a CSS list (#545) |
| 23 | - Add support for the `dvh`, `lvh` and `svh` length units (#415) |
| 24 | |
| 25 | ### Changed |
| 26 | |
| 27 | - Improve performance of Value::parseValue with many delimiters by refactoring to remove array_search() (#413) |
| 28 | |
| 29 | ## 8.5.2 |
| 30 | |
| 31 | ### Changed |
| 32 | |
| 33 | - Mark all class constants as `@internal` (#500) |
| 34 | |
| 35 | ### Fixed |
| 36 | |
| 37 | - Fix undefined local variable in `CalcFunction::parse()` (#593) |
| 38 | |
| 39 | ## 8.5.1 |
| 40 | |
| 41 | ### Fixed |
| 42 | |
| 43 | - Fix PHP notice caused by parsing invalid color values having less than 6 characters (#485) |
| 44 | - Fix (regression) failure to parse at-rules with strict parsing (#456) |
| 45 | |
| 46 | ## 8.5.0 |
| 47 | |
| 48 | ### Added |
| 49 | |
| 50 | - Add a method to get an import's media queries (#384) |
| 51 | - Add more unit tests (#381, #382) |
| 52 | |
| 53 | ### Fixed |
| 54 | |
| 55 | - Retain CSSList and Rule comments when rendering CSS (#351) |
| 56 | - Replace invalid `turns` unit with `turn` (#350) |
| 57 | - Also allow string values for rules (#348) |
| 58 | - Fix invalid calc parsing (#169) |
| 59 | - Handle scientific notation when parsing sizes (#179) |
| 60 | - Fix PHP 8.1 compatibility in `ParserState::strsplit()` (#344) |
| 61 | |
| 62 | ## 8.4.0 |
| 63 | |
| 64 | ### Features |
| 65 | |
| 66 | * Support for PHP 8.x |
| 67 | * PHPDoc annotations |
| 68 | * Allow usage of CSS variables inside color functions (by parsing them as regular functions) |
| 69 | * Use PSR-12 code style |
| 70 | * *No deprecations* |
| 71 | |
| 72 | ### Bugfixes |
| 73 | |
| 74 | * Improved handling of whitespace in `calc()` |
| 75 | * Fix parsing units whose prefix is also a valid unit, like `vmin` |
| 76 | * Allow passing an object to `CSSList#replace` |
| 77 | * Fix PHP 7.3 warnings |
| 78 | * Correctly parse keyframes with `%` |
| 79 | * Don’t convert large numbers to scientific notation |
| 80 | * Allow a file to end after an `@import` |
| 81 | * Preserve case of CSS variables as specced |
| 82 | * Allow identifiers to use escapes the same way as strings |
| 83 | * No longer use `eval` for the comparison in `getSelectorsBySpecificity`, in case it gets passed untrusted input (CVE-2020-13756). Also fixed in 8.3.1, 8.2.1, 8.1.1, 8.0.1, 7.0.4, 6.0.2, 5.2.1, 5.1.3, 5.0.9, 4.0.1, 3.0.1, 2.0.1, 1.0.1. |
| 84 | * Prevent an infinite loop when parsing invalid grid line names |
| 85 | * Remove invalid unit `vm` |
| 86 | * Retain rule order after expanding shorthands |
| 87 | |
| 88 | ### Backwards-incompatible changes |
| 89 | |
| 90 | * PHP ≥ 5.6 is now required |
| 91 | * HHVM compatibility target dropped |
| 92 | |
| 93 | ## 8.3.0 (2019-02-22) |
| 94 | |
| 95 | * Refactor parsing logic to mostly reside in the class files whose data structure is to be parsed (this should eventually allow us to unit-test specific parts of the parsing logic individually). |
| 96 | * Fix error in parsing `calc` expessions when the first operand is a negative number, thanks to @raxbg. |
| 97 | * Support parsing CSS4 colors in hex notation with alpha values, thanks to @raxbg. |
| 98 | * Swallow more errors in lenient mode, thanks to @raxbg. |
| 99 | * Allow specifying arbitrary strings to output before and after declaration blocks, thanks to @westonruter. |
| 100 | * *No backwards-incompatible changes* |
| 101 | * *No deprecations* |
| 102 | |
| 103 | ## 8.2.0 (2018-07-13) |
| 104 | |
| 105 | * Support parsing `calc()`, thanks to @raxbg. |
| 106 | * Support parsing grid-lines, again thanks to @raxbg. |
| 107 | * Support parsing legacy IE filters (`progid:`) in lenient mode, thanks to @FMCorz |
| 108 | * Performance improvements parsing large files, again thanks to @FMCorz |
| 109 | * *No backwards-incompatible changes* |
| 110 | * *No deprecations* |
| 111 | |
| 112 | ## 8.1.0 (2016-07-19) |
| 113 | |
| 114 | * Comments are no longer silently ignored but stored with the object with which they appear (no render support, though). Thanks to @FMCorz. |
| 115 | * The IE hacks using `\0` and `\9` can now be parsed (and rendered) in lenient mode. Thanks (again) to @FMCorz. |
| 116 | * Media queries with or without spaces before the query are parsed. Still no *real* parsing support, though. Sorry… |
| 117 | * PHPUnit is now listed as a dev-dependency in composer.json. |
| 118 | * *No backwards-incompatible changes* |
| 119 | * *No deprecations* |
| 120 | |
| 121 | ## 8.0.0 (2016-06-30) |
| 122 | |
| 123 | * Store source CSS line numbers in tokens and parsing exceptions. |
| 124 | * *No deprecations* |
| 125 | |
| 126 | ### Backwards-incompatible changes |
| 127 | |
| 128 | * Unrecoverable parser errors throw an exception of type `Sabberworm\CSS\Parsing\SourceException` instead of `\Exception`. |
| 129 | |
| 130 | ## 7.0.3 (2016-04-27) |
| 131 | |
| 132 | * Fixed parsing empty CSS when multibyte is off |
| 133 | * *No backwards-incompatible changes* |
| 134 | * *No deprecations* |
| 135 | |
| 136 | ## 7.0.2 (2016-02-11) |
| 137 | |
| 138 | * 150 time performance boost thanks to @[](https://github.com/ossinkineossinkine](https://github.com/ossinkine](https://github.com/ossinkine) |
| 139 | * *No backwards-incompatible changes* |
| 140 | * *No deprecations* |
| 141 | |
| 142 | ## 7.0.1 (2015-12-25) |
| 143 | |
| 144 | * No more suppressed `E_NOTICE` |
| 145 | * *No backwards-incompatible changes* |
| 146 | * *No deprecations* |
| 147 | |
| 148 | ## 7.0.0 (2015-08-24) |
| 149 | |
| 150 | * Compatibility with PHP 7. Well timed, eh? |
| 151 | * *No deprecations* |
| 152 | |
| 153 | ### Backwards-incompatible changes |
| 154 | |
| 155 | * The `Sabberworm\CSS\Value\String` class has been renamed to `Sabberworm\CSS\Value\CSSString`. |
| 156 | |
| 157 | ## 6.0.1 (2015-08-24) |
| 158 | |
| 159 | * Remove some declarations in interfaces incompatible with PHP 5.3 (< 5.3.9) |
| 160 | * *No deprecations* |
| 161 | |
| 162 | ## 6.0.0 (2014-07-03) |
| 163 | |
| 164 | * Format output using Sabberworm\CSS\OutputFormat |
| 165 | * *No backwards-incompatible changes* |
| 166 | |
| 167 | ### Deprecations |
| 168 | |
| 169 | * The parse() method replaces __toString with an optional argument (instance of the OutputFormat class) |
| 170 | |
| 171 | ## 5.2.0 (2014-06-30) |
| 172 | |
| 173 | * Support removing a selector from a declaration block using `$oBlock->removeSelector($mSelector)` |
| 174 | * Introduce a specialized exception (Sabberworm\CSS\Parsing\OuputException) for exceptions during output rendering |
| 175 | |
| 176 | * *No deprecations* |
| 177 | |
| 178 | #### Backwards-incompatible changes |
| 179 | |
| 180 | * Outputting a declaration block that has no selectors throws an OuputException instead of outputting an invalid ` {…}` into the CSS document. |
| 181 | |
| 182 | ## 5.1.2 (2013-10-30) |
| 183 | |
| 184 | * Remove the use of consumeUntil in comment parsing. This makes it possible to parse comments such as `/** Perfectly valid **/` |
| 185 | * Add fr relative size unit |
| 186 | * Fix some issues with HHVM |
| 187 | * *No backwards-incompatible changes* |
| 188 | * *No deprecations* |
| 189 | |
| 190 | ## 5.1.1 (2013-10-28) |
| 191 | |
| 192 | * Updated CHANGELOG.md to reflect changes since 5.0.4 |
| 193 | * *No backwards-incompatible changes* |
| 194 | * *No deprecations* |
| 195 | |
| 196 | ## 5.1.0 (2013-10-24) |
| 197 | |
| 198 | * Performance enhancements by Michael M Slusarz |
| 199 | * More rescue entry points for lenient parsing (unexpected tokens between declaration blocks and unclosed comments) |
| 200 | * *No backwards-incompatible changes* |
| 201 | * *No deprecations* |
| 202 | |
| 203 | ## 5.0.8 (2013-08-15) |
| 204 | |
| 205 | * Make default settings’ multibyte parsing option dependent on whether or not the mbstring extension is actually installed. |
| 206 | * *No backwards-incompatible changes* |
| 207 | * *No deprecations* |
| 208 | |
| 209 | ## 5.0.7 (2013-08-04) |
| 210 | |
| 211 | * Fix broken decimal point output optimization |
| 212 | * *No backwards-incompatible changes* |
| 213 | * *No deprecations* |
| 214 | |
| 215 | ## 5.0.6 (2013-05-31) |
| 216 | |
| 217 | * Fix broken unit test |
| 218 | * *No backwards-incompatible changes* |
| 219 | * *No deprecations* |
| 220 | |
| 221 | ## 5.0.5 (2013-04-17) |
| 222 | |
| 223 | * Initial support for lenient parsing (setting this parser option will catch some exceptions internally and recover the parser’s state as neatly as possible). |
| 224 | * *No backwards-incompatible changes* |
| 225 | * *No deprecations* |
| 226 | |
| 227 | ## 5.0.4 (2013-03-21) |
| 228 | |
| 229 | * Don’t output floats with locale-aware separator chars |
| 230 | * *No backwards-incompatible changes* |
| 231 | * *No deprecations* |
| 232 | |
| 233 | ## 5.0.3 (2013-03-21) |
| 234 | |
| 235 | * More size units recognized |
| 236 | * *No backwards-incompatible changes* |
| 237 | * *No deprecations* |
| 238 | |
| 239 | ## 5.0.2 (2013-03-21) |
| 240 | |
| 241 | * CHANGELOG.md file added to distribution |
| 242 | * *No backwards-incompatible changes* |
| 243 | * *No deprecations* |
| 244 | |
| 245 | ## 5.0.1 (2013-03-20) |
| 246 | |
| 247 | * Internal cleanup |
| 248 | * *No backwards-incompatible changes* |
| 249 | * *No deprecations* |
| 250 | |
| 251 | ## 5.0.0 (2013-03-20) |
| 252 | |
| 253 | * Correctly parse all known CSS 3 units (including Hz and kHz). |
| 254 | * Output RGB colors in short (#aaa or #ababab) notation |
| 255 | * Be case-insensitive when parsing identifiers. |
| 256 | * *No deprecations* |
| 257 | |
| 258 | ### Backwards-incompatible changes |
| 259 | |
| 260 | * `Sabberworm\CSS\Value\Color`’s `__toString` method overrides `CSSList`’s to maybe return something other than `type(value, …)` (see above). |
| 261 | |
| 262 | ## 4.0.0 (2013-03-19) |
| 263 | |
| 264 | * Support for more @-rules |
| 265 | * Generic interface `Sabberworm\CSS\Property\AtRule`, implemented by all @-rule classes |
| 266 | * *No deprecations* |
| 267 | |
| 268 | ### Backwards-incompatible changes |
| 269 | |
| 270 | * `Sabberworm\CSS\RuleSet\AtRule` renamed to `Sabberworm\CSS\RuleSet\AtRuleSet` |
| 271 | * `Sabberworm\CSS\CSSList\MediaQuery` renamed to `Sabberworm\CSS\RuleSet\CSSList\AtRuleBlockList` with differing semantics and API (which also works for other block-list-based @-rules like `@supports`). |
| 272 | |
| 273 | ## 3.0.0 (2013-03-06) |
| 274 | |
| 275 | * Support for lenient parsing (on by default) |
| 276 | * *No deprecations* |
| 277 | |
| 278 | ### Backwards-incompatible changes |
| 279 | |
| 280 | * All properties (like whether or not to use `mb_`-functions, which default charset to use and – new – whether or not to be forgiving when parsing) are now encapsulated in an instance of `Sabberworm\CSS\Settings` which can be passed as the second argument to `Sabberworm\CSS\Parser->__construct()`. |
| 281 | * Specifying a charset as the second argument to `Sabberworm\CSS\Parser->__construct()` is no longer supported. Use `Sabberworm\CSS\Settings::create()->withDefaultCharset('some-charset')` instead. |
| 282 | * Setting `Sabberworm\CSS\Parser->bUseMbFunctions` has no effect. Use `Sabberworm\CSS\Settings::create()->withMultibyteSupport(true/false)` instead. |
| 283 | * `Sabberworm\CSS\Parser->parse()` may throw a `Sabberworm\CSS\Parsing\UnexpectedTokenException` when in strict parsing mode. |
| 284 | |
| 285 | ## 2.0.0 (2013-01-29) |
| 286 | |
| 287 | * Allow multiple rules of the same type per rule set |
| 288 | |
| 289 | ### Backwards-incompatible changes |
| 290 | |
| 291 | * `Sabberworm\CSS\RuleSet->getRules()` returns an index-based array instead of an associative array. Use `Sabberworm\CSS\RuleSet->getRulesAssoc()` (which eliminates duplicate rules and lets the later rule of the same name win). |
| 292 | * `Sabberworm\CSS\RuleSet->removeRule()` works as it did before except when passed an instance of `Sabberworm\CSS\Rule\Rule`, in which case it would only remove the exact rule given instead of all the rules of the same type. To get the old behaviour, use `Sabberworm\CSS\RuleSet->removeRule($oRule->getRule()`; |
| 293 | |
| 294 | ## 1.0 |
| 295 | |
| 296 | Initial release of a stable public API. |
| 297 | |
| 298 | ## 0.9 |
| 299 | |
| 300 | Last version not to use PSR-0 project organization semantics. |
| 301 |