All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
Please also have a look at our API and deprecation policy.
OutputFormat::setSpaceAroundSelectorCombinator() (#1504)RuleSet\RuleContainer is renamed to RuleSet\DeclarationList (#1530, #1539)setRule() in RuleSet and DeclarationBlock have been renamed
to setDeclaration(), etc. (#1521)Rule\Rule class is renamed to Property\Declaration
(#1508, #1512, #1513, #1522)Rule::setRule() and getRule() are replaced with setPropertyName() and
getPropertyName() (#1506)Selector is now represented as a sequence of Selector\Component objects
which can be accessed via getComponents(), manipulated individually, or set
via setComponents() (#1478, #1486, #1487, #1488, #1494, #1496, #1536, #1537)Selector::setSelector() and Selector constructor will now throw exception
upon provision of an invalid selectior (#1498, #1502)DeclarationBlock::setSelectors() are no longer
preserved (#1407)RuleSet\RuleContainer is deprecated; use RuleSet\DeclarationList instead
(#1530)setRule() in RuleSet and DeclarationBlock are deprecated;
there are direct replacements such as setDeclaration() (#1521)Rule\Rule class is deprecated; Property\Declaration is a direct
replacement (#1508)Rule::setRule() and getRule() are deprecated and replaced with
setPropertyName() and getPropertyName() (#1506, #1519)} is encountered (#1425, #1426)DeclarationBlock::setSelectors() (#1419)removeDeclarationBlockBySelector() to be order-insensitve (#1406)calc expressions when a newline immediately precedes or
follows a + or - operator (#1399)RuleContainer for RuleSet Rule manipulation methods (#1256)rgb and rgba, and hsl and hsla are now aliases (#797)none as color function component value (#859)DeclarationBlock no longer extends RuleSet and instead has a RuleSet as
a property; use getRuleSet() to access it directly (#1194)null (not zero) (#1288)setPosition() (in Rule and other classes) now has fluent interface,
returning itself (#1259)RuleSet::removeRule() now only allows Rule as the parameter
(implementing classes are AtRuleSet and DeclarationBlock);
use removeMatchingRules() or removeAllRules() for other functions (#1255)RuleSet::getRules() and getRulesAssoc() now only allow string or null
as the parameter (implementing classes are AtRuleSet and DeclarationBlock)
(#1253)KeyFrame properties to sensible defaults (#1146)OutputFormat final (#1128)Selector a Renderable (#1017)string for some OutputFormat properties (#885)getLineNo() from these classes (use getLineNumber() instead):
Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1258)Rule::getColNo() (use getColumnNumber() instead) (#1287)getAllValues() is no longer
supported and will not work;
the search pattern should now be passed as the second argument (#1243)getAllValues() is no longer
supported and will not work; the flag for searching in function arguments
should now be passed as the third argument (#1243)__toString() (#1046)OutputFormat (#898)atRuleArgs() from the AtRule interface (#1141)OutputFormat::get() and ::set() (#1108, #1110)Rule (#995)getLineNo() from the Renderable interface (#1038)OutputFormat::level() (#874)Parser::setCharset/getCharset (#808)Rule::getValues() (#582)Rule::setValues() (#562)Document::getAllSelectors() (#561)DeclarationBlock::getSelector() (#559)DeclarationBlock::setSelector() (#560)OutputFormat (#1345):not) with comma-separated arguments (#1292):not(html, body)) (#1293)Rule before sibling even with different property name
(in RuleSet::addRule()) (#1270)RuleSet::addRule() sets non-negative column number when sibling
provided (#1268)rgb colors with percentage values using hex notation (#803)@ziegenberg is a new contributor to this release and did a lot of the heavy lifting. Thanks! :heart:
RuleSet::removeMatchingRules() method
(for the implementing classes AtRuleSet and DeclarationBlock) (#1249)RuleSet::removeAllRules() method
(for the implementing classes AtRuleSet and DeclarationBlock) (#1249)CSSElement (#1231)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)getAllValues() are deconflated, so it now takes three (all
optional), allowing $element and $ruleSearchPattern to be specified
separately (#1241)Positionable in the following CSS item classes:
Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225)string or null to RuleSet::removeRule() is deprecated
(implementing classes are AtRuleSet and DeclarationBlock);
use removeMatchingRules() or removeAllRules() instead (#1249)Rule to RuleSet::getRules() or getRulesAssoc() is deprecated,
affecting the implementing classes AtRuleSet and DeclarationBlock
(call e.g. getRules($rule->getRule()) instead) (#1248)getAllValues() is deprecated;
the search pattern should now be passed as the second argument (#1241)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)Rule::setPosition() is
deprecated (pass null instead if there is no line number) (#1225, #1233)RuleSet::addRule() called with only column number set
(#1265)RuleSet::addRule() has valid position (#1262)OutputFormat properties for space around specific list separators (#880)OutputFormat constructor as @internal (#1131)OutputFormatter as @internal (#896)Selector::isValid() as @internal (#1037)@internal (#908)OutputFormat::nextLevel() as @internal (#901)@internal (#886)OutputFormat (#1131)OutputFormat::get() and ::set() (#1107)-webkit-calc and -moz-calc (#1086)OutputFormat to OutputFormatter
(#894)__toString() (#1006)Rule (#993, #1003)OutputFormat properties for space around list separators as an array (#880)OutputFormat::level() (#870)Size with correct types in expandBackgroundShorthand (#814)@font-face src property as comma-delimited list (#794)@internal (#674)Parser::setCharset() and Parser::getCharset() (#688)dvh, lvh and svh length units (#415)Value::parseValue with many delimiters by refactoring
to remove array_search() (#413)@internal (#472)CalcFunction::parse() (#593)turns unit with turn (#350)ParserState::strsplit() (#344)calc()vminCSSList#replace%@importeval 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.vmcalc expessions when the first operand is a negative
number, thanks to @raxbg.calc(), thanks to @raxbg.progid:) in lenient mode, thanks to
@FMCorz\0 and \9 can now be parsed (and rendered) in lenient
mode. Thanks (again) to @FMCorz.Sabberworm\CSS\Parsing\SourceException instead of \Exception.E_NOTICESabberworm\CSS\Value\String class has been renamed to
Sabberworm\CSS\Value\CSSString.$oBlock->removeSelector($mSelector)Introduce a specialized exception (Sabberworm\CSS\Parsing\OuputException) for exceptions during output rendering
No deprecations
{…} into the CSS document./** Perfectly valid **/Sabberworm\CSS\Value\Color’s __toString method overrides CSSList’s to
maybe return something other than type(value, …) (see above).Sabberworm\CSS\Property\AtRule, implemented by all @-rule
classesSabberworm\CSS\RuleSet\AtRule renamed to Sabberworm\CSS\RuleSet\AtRuleSetSabberworm\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).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().Sabberworm\CSS\Parser->__construct() is no longer supported. Use
Sabberworm\CSS\Settings::create()->withDefaultCharset('some-charset')
instead.Sabberworm\CSS\Parser->bUseMbFunctions has no effect. Use
Sabberworm\CSS\Settings::create()->withMultibyteSupport(true/false) instead.Sabberworm\CSS\Parser->parse() may throw a
Sabberworm\CSS\Parsing\UnexpectedTokenException when in strict parsing mode.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).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();Initial release of a stable public API.
Last version not to use PSR-0 project organization semantics.