Cssutils

Latest version: v2.11.1

Safety actively analyzes 682404 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 11 of 21

0.9.7b2

+ IMPROVEMENT/BUGFIX: CSSFunction value parameters may contain HASH values like ``fff`` now. These are used in experimental properties like ``-moz-linear-gradient(top,fff,fff 55%,e4e4e4)``. Fixes Bitbucket 38.

+ API CHANGE: ``cssutils.ser.prefs.resolveVariables == True`` is the default from 0.9.7b2 as CSSVariables are not in any official specification yet and better reflects what you probably want after serializing a stylesheet...

0.9.7b1

+ **API CHANGE**: Child objects like the ``cssRules`` of a ``CSSStyleSheet`` or ``CSSMediaRule`` are no longer kept after resetting the complete contents of an object (setting ``cssText``). This should not be expected anyway but if you relied on something like the following please beware::

sheet = cssutils.parseString('a { color: red}')
initial_rules = sheet.cssRules
sheet.cssText = 'b { color: green}'
true until 0.9.6a6: assert sheet.cssRules == initial_rules, but now:
assert sheet.cssRules != initial_rules

+ **IMPROVEMENT**: Massive speed improvement of handling of CSSVariables of a stylesheet which due to naive implementation was unbelievable slow when using a lot of vars... Should now scale a lot better, about factor 5-20 depending of amount of variables used.
+ IMPROVEMENT: Fair amount of refactoring resulting in a bit speed improvement generally too
+ CHANGE: If a CSS variable should be resolved (``cssutils.ser.prefs.resolveVariables == true``) but no value can be found a WARNING is logged now. Should be an ERROR actually but as currently lots of "fake" errors are reported would probably hurt more than help. A future release might improve this.
+ BUGFIX: Syntax of value of CSS Fonts Module Level 3 ``src`` property now validates if local font name is given with a quoted name, e.g.: ``src: local('Yanone Kaffeesatz')``

0.9.7a6

+ **API CHANGE (major)**: When setting an objects ``cssText`` (or ``selectorText`` etc) property the underlying object is replaced with a new one now. E.g. if setting ``cssutils.css.CSSStyleRule.selectorText`` the underlying ``cssutils.css.CSSStyleRule.selectorList`` object is swapped to a new ``SelectorList`` object. This should be expected but cssutils until now kept the exact same object and changed its content *in-place*. Please be aware! (Also the strange ``_absorb`` method of some objects is gone which was used for this.)

+ **API CHANGE (minor)**: Renamed ``cssutils.ser.prefs.keepUnkownAtRules`` to ``cssutils.ser.prefs.keepUnknownAtRules`` due to misspelling, see Issue Bitbucket 37. A DeprecationWarning is issued on use.

+ API CHANGES (minor):
- ``cssutils.css.CSSImportRule.media`` and ``cssutils.css.CSSMediaRule.media`` are now writable (setting with a string or ``cssutils.stylesheets.MediaList``)
- msg level when setting ``cssutils.stylesheets.MediaList.appendMedium`` changed to INFO (was WARNING)
- ``str(cssutils.css.CSSStyleRule)`` slightly changed

- **IMPROVEMENT/BUGFIX**: Improved distribution: Egg release should no longer include the tests package, source release still should. Also added dependency package for tests (minimock) and removed documenation txt files from distribution (HTML still included of course). This also fixes Issue Bitbucket 36.

- IMPROVEMENT: cssutils issues a warning if a page selector is not one of the defined in the spec (``:first``, ``:left``, ``:right``).

- IMPROVEMENT: Refactored quite a lot and added a few tests for variables

0.9.7a5

- same changes as 0.9.7a6 but release was incomplete :(

0.9.7a4

- **API CHANGE**: ``CSSRule.NAMESPACE_RULE`` actual value has been changed from 8 to 10 (according to the change in the CSSOM spec). The actual integer values **SHOULD NOT** be used anyway! **Please do always use the ``CSSRule`` constants which are present in ALL CSSRule and subclass objects like CSSStyleRule, CSSImportRule etc.!**

- **API CHANGE**: ``CSSStyleSheet.setSerializer`` and ``CSSStyleSheet.setSerializerPref`` have been DEPRECATED. Use ``cssutils.setSerializer(serializer)`` or set pref in ``cssutils.ser.prefs`` instead.

- **IMPROVEMENT/CHANGE**: Did some minor changes to improve compliance to http://dev.w3.org/csswg/cssom
+ **MAJOR**: :class:`cssutils.css.CSSImportRule.styleSheet` always references a CSSStyleSheet now. ``parentStyleSheet`` of this sheet is ``None`` now
+ MINOR: added property ``alternate`` to :class:`cssutils.stylesheets.StyleSheet`, which for now is always ``False``
+ improved handling of encodings during imports (edge cases hopefully not found in the wild ;)

+ **FEATURE**: Started experimental implementation of `CSS Variables <http://disruptive-innovations.com/zoo/cssvariables/>`_

**experimental and incomplete**

Related details:

- added ``cssutils.css.CSSStyleSheet.variables`` which is a :class:`cssutils.css.CSSVariablesDeclaration` containing all available variables in this CSSStyleSheet including the ones defined in imported sheets.
- ``cssutils.ser.prefs.resolveVariables == False``: If set to ``True`` tries to resolve all variable references and removes any CSSVariablesRules.
- ``cssutils.ser.prefs.normalizedVarNames==True``: Defines if variable names should be serialized normalized (they are used as being normalized anyway)

+ FEATURE: Added new options to ``cssutils.script.csscombine``:
+ ``cssText=None`` and ``href=None`` to start combination from a css string, which normally needs ``href`` to be able to resolve any imports.
+ ``resolveVariables=False`` which resolves any variables if given the value ``True``


+ DOCUMENTATION: Reordered and cleared docs up a bit

0.9.7a3

- **API CHANGE**: ``CSSRule.NAMESPACE_RULE`` actual value has been changed from 7 to 8 (according to the change in the spec). Also ``CSSRule.COMMENT`` has a value of ``1001`` (was ``-1``) and ``CSSRule.VARIABLES_RULE`` has a value of ``1008`` (was ``8``) now (being not in the official spec yet anyway but values are now in the open valuespace above 1000). The actual integer values **SHOULD NOT** be used anyway! **Please do always use the ``CSSRule`` constants which are present in ALL CSSRule and subclass objects like CSSStyleRule, CSSImportRule etc.!**

+ FEATURE: Added ``CSSRuleList.rulesOfType(type)`` which return and iterator the rules of the given type only. May be used on both ``CSSStyleSheet.cssRules`` or ``CSSMediaRule.cssRules``. ``type`` is one of the constants defined in ``css.CSSRule`` like e.g. ``css.CSSRule.STYLE_RULE``.

+ FEATURE (strange): IE specific values like ``DropShadow(color=eee, offX=2, offY=1)`` (and ``Blur``, ``Shadow``) *should* be parsed and serialized now as an ``Expression`` value. I have not tested this deeply and there may be problems but for some common cases theses values should at least survive a parse/serialize with cssutils.

- **BUGFIX/IMPROVEMENT**: Parser now handles FUNCTION values which themselves contain another FUNCTION as used by PrinceXML CSS like e.g. ``prince-link: target-counter(attr(href), page)``

Page 11 of 21

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.