Cssutils

Latest version: v2.11.1

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

Scan your dependencies

Page 10 of 21

0.9.8a3

+ BUGFIX: Fixed validation of ``size`` property (thanks to Simon Sapin)
+ BUGFIX: Fixed Issue Bitbucket 55 (thanks to Simon Sapin): `outline-color` property was missing from validation.
+ BUGFIX: Fixed resolution of encoding detection of a stylesheet which did not use charset in certain circumstances (mainly when imported sheets use different encoding than importing one which should be quite rare actually).

- FEATURE: Added ``URIValue.absoluteUri`` (thanks to Simon Sapin)
- FEATURE: Issue Bitbucket 53 feature request: Added new Preference option ``cssutils.ser.prefs.indentClosingBrace``. Defines if closing brace of block is indented to match indentation of the block (default) oder match indentation of selector.
- FEATURE: Feature request: Added new Preference option ``cssutils.ser.prefs.omitLeadingZero``. Defines if values between -1 and 1 should omit the 0, like ``.5px``. Minified settings do this, else 0 is kept by default.

+ CHANGE (minor): Some error messages have slightly changed due to a simpler compatibility to Python 3. Problem are any ``u'...'`` texts inside error messages which now are simplified, some without and quotes. Changed are e.g. error messages by ``Property``.

- **IMPROVEMENT**: Python 3 support. At least the unittests run in Python 2.5, 2.6, 2.7, 3.2 and Jython 2.5.1 now. Both encutils (with support by Fredrik Hedman, thanks!) and cssutils (thanks to Jaraco) and the CSS codec (thanks to Walter Dörwald) seem to work with Python 3 (tested on Python 3.2.1 Win64). Tests use Mock instead of MiniMock now as former is available for Python 2.x and 3.x.

- **IMPROVEMENT**: Parsing of longer (and probably invalid) ``font`` or ``font-family`` values was *extremely* slow due to a very complex regex. This has been changed and parsing of specific stylesheets using these values should be much faster now. (``macros[Profiles.CSS_LEVEL_2]['font-family']`` is gone so if you used this in your own validation modules you need to check the source in `profiles.py`.)

- IMPROVEMENT: Fixed Issue Bitbucket 54 (thanks to Simon Sapin): Short hand like `f80` color value object have correct red, green and blue property values now. Also ``hsl()`` and ``hsla()`` colors report (almost) correct values (due to rounding problems).

- **Source control has moved to bitbucket https://bitbucket.org/cthedot/cssutils**. Older Issues are currently still at Google Code, newer at Bitbucket. Please do not use Google Code for new issue reports anymore!

0.9.8a2

- BUGFIX: Fixed Issue Bitbucket 59 which showed a rather strange problem with longer space separated lists of font-family values being so slow to actually stop parsing.

- BUGFIX/IMPROVEMENT: Fixed Issue Bitbucket 48. ``CSSParser.parseUrl()`` uses the defined fetcher of this parser *for the initial stylesheet* at url too and not just the imported sheets *from* this sheet.

- BUGFIX: Fixed Issue Bitbucket 50 which prevented cssutils parsing the acid2.css file correctly. Problem were selectors starting directly with ``[class]`` (an attribute selector).

+ **API CHANGE (major)**
(Known) named colors are parsed as ColorValue objects now. These are the 16 simple colors (black, white, etc) and `transparent` but not all Extended color keywords yet. Also changed ``ColorValue.type`` to ``Value.COLOR_VALUE``. ColorValue has additional properties ``red, green, blue, alpha`` and ``colorType`` which is one of IDENT, HASH or FUNCTION for now.

+ API CHANGE (minor)
Removed already DEPRECATED ``cssutils.parse`` and ``CSSParser.parse``. Use the more specific functions/methods ``parseFile parseString parseUrl`` instead.

Removed already DEPRECATED ``cssutils.log.setlog`` and ``.setloglevel``. Use ``.setLog`` and ``.setLevel`` instead.

Removed already DEPRECATED ``cssutils.ser.keepUnkownAtRules`` (note the typo). Use ``.keepUnknownAtRules`` instead.

- IMPROVEMENT: Added validation profiles for some properties from `CSS Backgrounds and Borders Module Level 3 <http://www.w3.org/TR/css3-background/>`__, `CSS3 Basic User Interface Module <http://www.w3.org/TR/css3-ui/#resize>`__, `CSS Text Level 3 <http://www.w3.org/TR/css3-text/>`__
mainly `cursor`, `outline`, `resize`, `box-shadow`, `text-shadow`

0.9.8a1

+ **API CHANGE (major)**
replace CSSValue with PropertyValue, Value and other classes.

NEW CLASSES:
:class:`cssutils.css.PropertyValue`
replaces CSSValue and CSSValueList

- is iterable (iterates over all single Value objects which in soruce CSS might be separated by "," "/" or " "
- a comma separated list of IDENT values is no longer handled as a single String (e.g. ``Arial, sans-serif``)

:class:`cssutils.css.Value`
replaces CSSPrimitiveValue with separate ``value`` and ``type`` info (value is typed, so e.g. string for e.g. STRING, IDENT or URI values, int or float) and is base class for more specific values like:

:class:`cssutils.css.URIValue`
replaces CSSPrimitiveValue, additional attribute ``uri``

:class:`cssutils.css.DimensionValue`
replaces CSSPrimitiveValue, additional attribute ``dimension``

:class:`cssutils.css.ColorValue`
replaces CSSPrimitiveValue, additional attribute ``red``, ``green``, ``blue`` and ``alpha``

**TODO: Not yet complete, only rgb, rgba, hsl, hsla and has values use this object and color and alpha information no done yet!**

:class:`cssutils.css.CSSFunction`
replaces CSSPrimitiveValue function, not complete yet

also renamed ``ExpressionValue`` to :class:`cssutils.css.MSValue` with new API

- IMPROVEMENT/CHANGE: Validation of color values is tighter now. Values like ``hsl(1, 2, 3)`` do not validate as it must be ``hsl(1, 2%, 3%)``. This mostly effects HSL/A and RGB/A notation.

- **IMPROVEMENT**: New Value parsing and API accelerate parsing of style declarations which take about 20-30% less time now. Of course this depends on the complexity of your styles.

+ BUGFIX: fixes Bitbucket 41, Bitbucket 42, Bitbucket 45, Bitbucket 46
PropertyValue.value returns value without any comments now, else use PropertyValue.cssText

- FEATURE: ``cssutils.replaceUrls()`` accepts as first argument a `cssutils.css.CSSStyleSheet` but now also a
:class:`cssutils.css.CSSStyleDeclaration` object, so may be used like the following which is useful when you work with HTML style attributes::

>>> style = cssutils.parseStyle("background-image: url(1.png), url('2.png')")
>>> cssutils.replaceUrls(style, lambda url: 'prefix/'+url)
>>> print style.cssText
background-image: url(prefix/1.png), url(prefix/2.png)

(I omitted the validation error message as more than one background-image is not yet defined in the cssutils validator but does parse through without problems)

+ CHANGE: explicit `+` of any dimension, percentage of number value is kept now instead of being stripped as if put explicitly in the author SHOULD have meant something ;)

0.9.7

======

+ **FUTURE CHANGE**: CSSValue and subclasses will most certain not be supported in the next cssutils 0.9.8 version. A simpler and hopefully more robust API is in development. So the next version will have incompatible changes so you might wanna use 0.9.8 from the start if you do anything fancy with CSSValue and related classes.

0.9.7b4

+ *EXPERIMENTAL*: CSS function values using ``calc(...)`` should be partly parsable now (as experimental ExpressionValues currently)

- BUGFIX: MS specific values are parsed a bit more reliable if parsing of these values is activated (they probable are syntactically invalid!). E.g. ``top: expression(eval(document.documentElement.scrollTop))`` and also a few values for the MS specific ``filter`` property are parsed and reserialized now.

+ IMPROVEMENT: ``CSSStyleSheet.variables`` now contains all available variable values (from all imported sheets as well as in sheet defined itself)

0.9.7b3

+ API CHANGE: Changed parameters of script/utility function ``csscombine``.
- parameter ``resolveVariables=True`` now (default was ``False`` before)
- ``minify = True`` will not parse Comments at all. This is not really a change as comments were not kept in a minified stylesheet anyway but this may speed up stylesheet combination a bit

+ **PERFORMANCE/IMPROVEMENT**: Added parameter ``parseComments=True`` to CSSParser. If parsing with ``parser = cssutils.CSSParser(parseComments=False).parse...`` comments in a given stylesheet are simple omitted from the resulting stylesheet DOM.

+ **PERFORMANCE**: Compiled productions in cssutils tokenizer are cached now (to clear it use ``cssutils.tokenize2._TOKENIZER_CACHE.clear()``) which results in a slight performance improvement. Thanks to Amit Moscovich!

Page 10 of 21

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.