Skip to content

Releases: MyIntervals/PHP-CSS-Parser

8.9.0: New features, bug fixes and deprecations

11 Jul 13:36
v8.9.0
d8e9165
Compare
Choose a tag to compare

Added

  • RuleSet::removeMatchingRules() method
    (for the implementing classes AtRuleSet and DeclarationBlock) (#1249)
  • RuleSet::removeAllRules() method
    (for the implementing classes AtRuleSet and DeclarationBlock) (#1249)
  • Add Interface CSSElement (#1231)
  • Methods getLineNumber and getColumnNumber which return a nullable int
    for the following classes:
    Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
    Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225, #1263)
  • Positionable interface for CSS items that may have a position
    (line and perhaps column number) in the parsed CSS (#1221)

Changed

  • Parameters for getAllValues() are deconflated, so it now takes three (all
    optional), allowing $element and $ruleSearchPattern to be specified
    separately (#1241)
  • Implement Positionable in the following CSS item classes:
    Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
    Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225)

Deprecated

  • Support for PHP < 7.2 is deprecated; version 9.0 will require PHP 7.2 or later
    (#1264)
  • Passing a string or null to RuleSet::removeRule() is deprecated
    (implementing classes are AtRuleSet and DeclarationBlock);
    use removeMatchingRules() or removeAllRules() instead (#1249)
  • Passing a Rule to RuleSet::getRules() or getRulesAssoc() is deprecated,
    affecting the implementing classes AtRuleSet and DeclarationBlock
    (call e.g. getRules($rule->getRule()) instead) (#1248)
  • Passing a string as the first argument to getAllValues() is deprecated;
    the search pattern should now be passed as the second argument (#1241)
  • Passing a Boolean as the second argument to getAllValues() is deprecated;
    the flag for searching in function arguments should now be passed as the third
    argument (#1241)
  • getLineNo() is deprecated in these classes (use getLineNumber() instead):
    Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
    Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225, #1233)
  • Rule::getColNo() is deprecated (use getColumnNumber() instead)
    (#1225, #1233)
  • Providing zero as the line number argument to Rule::setPosition() is
    deprecated (pass null instead if there is no line number) (#1225, #1233)

Fixed

  • Set line number when RuleSet::addRule() called with only column number set
    (#1265)
  • Ensure first rule added with RuleSet::addRule() has valid position (#1262)

V8.8.0: Bug fixes and deprecations

23 Mar 19:04
v8.8.0
3de493b
Compare
Choose a tag to compare

Added

  • OutputFormat properties for space around specific list separators (#880)

Changed

  • Mark the OutputFormat constructor as @internal (#1131)
  • Mark OutputFormatter as @internal (#896)
  • Mark Selector::isValid() as @internal (#1037)
  • Mark parsing-related methods of most CSS elements as @internal (#908)
  • Mark OutputFormat::nextLevel() as @internal (#901)
  • Make all non-private properties @internal (#886)

Deprecated

  • Deprecate extending OutputFormat (#1131)
  • Deprecate OutputFormat::get() and ::set() (#1107)
  • Deprecate support for -webkit-calc and -moz-calc (#1086)
  • Deprecate magic method forwarding from OutputFormat to OutputFormatter
    (#894)
  • Deprecate __toString() (#1006)
  • Deprecate greedy calculation of selector specificity (#1018)
  • Deprecate the IE hack in Rule (#993, #1003)
  • OutputFormat properties for space around list separators as an array (#880)
  • Deprecate OutputFormat::level() (#870)

Fixed

  • Include comments for all rules in declaration block (#1169)
  • Render rules in line and column number order (#1059)
  • Create Size with correct types in expandBackgroundShorthand (#814)
  • Parse @font-face src property as comma-delimited list (#794)

V8.7.0: Add support for PHP 8.4

27 Oct 17:43
v8.7.0
f414ff9
Compare
Choose a tag to compare

Added

Changed

  • Mark parsing-internal classes and methods as @internal (#711)
  • Block installations on unsupported higher PHP versions (#691)

Deprecated

  • Deprecate the expansion of shorthand properties (#719)
  • Deprecate Parser::setCharset() and Parser::getCharset() (#703)

V8.6.0: Critical features

01 Jul 07:35
v8.6.0
d2fb94a
Compare
Choose a tag to compare

Added

  • Support arithmetic operators in CSS function arguments (#607)
  • Add support for inserting an item in a CSS list (#545)
  • Add support for the dvh, lvh and svh length units (#415)

Changed

  • Improve performance of Value::parseValue with many delimiters by refactoring to remove array_search() (#413)

V8.5.2: Bug fixes

28 Jun 16:39
v8.5.2
ef8c59c
Compare
Choose a tag to compare

Changed

  • Mark all class constants as @internal (#500)

Fixed

  • Fix undefined local variable in CalcFunction::parse() (#593)

V8.5.1: Bug fixes

15 Feb 17:41
v8.5.1
4a3d572
Compare
Choose a tag to compare

Fixed

  • Fix (regression) failure to parse at-rules with strict parsing (#456)

V8.5.0

01 Feb 09:25
8.5.0
4e9a54c
Compare
Choose a tag to compare

Added

  • Add a method to get an import's media queries (#384)
  • Add more unit tests (#381, #382)

Fixed

  • Retain CSSList and Rule comments when rendering CSS (#351)
  • Replace invalid turns unit with turn (#350)
  • Also allow string values for rules (#348)
  • Fix invalid calc parsing (#169)
  • Handle scientific notation when parsing sizes (#179)
  • Fix PHP 8.1 compatibility in ParserState::strsplit() (#344)

V8.4.0

19 Jan 09:45
Compare
Choose a tag to compare

Features

  • Support for PHP 8.x
  • PHPDoc annotations
  • Allow usage of CSS variables inside color functions (by parsing them as regular functions)
  • Use PSR-12 code style
  • No deprecations

Bugfixes

  • Improved handling of whitespace in calc()
  • Fix parsing units whose prefix is also a valid unit, like vmin
  • Allow passing an object to CSSList#replace
  • Fix PHP 7.3 warnings
  • Correctly parse keyframes with %
  • Don’t convert large numbers to scientific notation
  • Allow a file to end after an @import
  • Preserve case of CSS variables as specced
  • Allow identifiers to use escapes the same way as strings
  • 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.
  • Prevent an infinite loop when parsing invalid grid line names
  • Remove invalid unit vm
  • Retain rule order after expanding shorthands

Backwards-incompatible changes

  • PHP ≥ 5.6 is now required
  • HHVM compatibility target dropped

8.3.0: The “Ready for the good times” release

22 Feb 07:44
Compare
Choose a tag to compare

8.3.0 (2019-02-22)

  • 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).
  • Fix error in parsing calc expessions when the first operand is a negative number, thanks to @raxbg.
  • Support parsing CSS4 colors in hex notation with alpha values, thanks to @raxbg.
  • Swallow more errors in lenient mode, thanks to @raxbg.
  • Allow specifying arbitrary strings to output before and after declaration blocks, thanks to @westonruter.
  • No backwards-incompatible changes
  • No deprecations

8.2.0: The “calc(this + that)” release

22 Feb 07:46
Compare
Choose a tag to compare

8.2.0 (2018-07-13)

  • Support parsing calc(), thanks to @raxbg.
  • Support parsing grid-lines, again thanks to @raxbg.
  • Support parsing legacy IE filters (progid:) in lenient mode, thanks to @FMCorz
  • Performance improvements parsing large files, again thanks to @FMCorz
  • No backwards-incompatible changes
  • No deprecations