Cssutils

Latest version: v2.11.1

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

Scan your dependencies

Page 19 of 21

0.9.1a1

- CHANGE, renamed ``Serializer.prefs.srcatkeyword`` to ``Serializer.prefs.normalkeyword``
which work just the other way round but work as ``Serializer.prefs.normalpropertyname``

- BUGFIX in css.Selector and added support regarding handling of pseudoclasses (``:x`` or ``:x()``) and pseudoelements ``::x``

- BUGFIX and refactoring in tokenizer, mostly regarding escape sequences
* combination of \ and NEWLINE in a string is removed according to spec now

- added ``Serializer.prefs.normalpropertyname``, if True, property names are normalized if known (``color``), else literal form from CSS src is used (e.g. ``c\olor``). Defaults to ``True``.
- removed ``Token.literal`` which value is in ``value`` now, normalized value is in ``normalvalue``
- removed ``Token.ESCAPE``. Escapes are contained in IDENTifiers now.
- internal change: WS is generally kept by tokenizer now, former normalized value ``u' '`` is hold in ``Token.normalvalue``. Serializer does not use it yet and some classes (like Selector) use normalvalue.

uses normalized form of keyword in source CSS if ``True`` (e.g. ``import``), else literal form in CSS sourcefile (e.g. ``i\mport``). Defaults to ``True``.

0.9a6

- NEW ``Serializer.prefs.keepcomments`` removes all comments if ``False``, defaults to ``True``

- NEW ``Serializer.prefs.srcatkeyword`` UPDATE see 9.91a1

- fixed tokenizer to handle at least simple escapes like ``c\olor`` which is the same as ``color``. The original value is preserved but not used yet except in CSSComments which preserve the original values. See also Serializer.prefs.srcatkeywords

- ``CSSMediaRule`` tested and lots of bugfixes
* constructor has **no** parameters anymore (``mediaText`` is removed!)
* ``addRule`` is DEPRECATED, use ``insertRule(rule)`` with no index instead.
Synchronized with ``CSSStyleSheet.insertRule``

- setting of ``CSSImportRule.media`` removed, use methods of this object directly.
Synchronized with ``CSSMediaRule.media``

- ``CSSStyleSheet.insertRule`` raises ``xml.dom.IndexSizeErr`` if an invalid index is given. Index may be ``None`` in which case the rule will be appended.
Synchronized with ``CSSMediaRule.insertRule``

- CSSStyleDeclaration bugfixes in parsing invalid tokens
- stylesheets.MediaList bugfixes in parsing uppercase media values like ``PRINT``
- added more unittests (CSSMediaRule)
- various bugfixes

0.9a5

- reimplemented property validator:
- for unknown CSS2 Properties a INFO message is logged
- for invalid CSS2 Property values a WARNING message is issued

- atrules have a new property ``atkeyword`` which is the keyword used in the CSS provided. Normally something like "import" but may also be an escaped version like "im\port" or a custom one used in CSSUnknownRule.

- tokenizer and css.selector.Selector
- added CSS3 combinator ``~``
- added CSS3 attribute selectors ``^=``, ``$=``, ``*=``
- added CSS3 pseudo selector ``::`` and pseudo-functions like ``:lang(fr)``

- Token
- added some new constants mainly replacing DELIM, e.g. UNIVERSAL, GREATER, PLUS, TILDE

(CSS3 see http://www.w3.org/TR/css3-selectors)

- Improved parsing of "Unexpected end of string" according to spec
- fixed serializing of CSSUnknownRule if ``valid == False``

- Properties may also be set with a numeric value now, before everything had to be a string. Direct use of _Property is discouraged though as it may well be changed again in a future version.

0.9a4

- CSSStyleSheet:
- removed init parameter ``type`` which is now set as a static type to "text/css"
- removed ``addRule`` which emits DeprecationWarning now
Use ``insertRule`` without parameter ``index``
- added new methods ``setSerializer(cssserializer)`` and
``setSerializerPref(self, pref, value)`` to control output
of a stylesheet directly.

- CSSStyleRule:
- new property ``selectorList`` is an instance of SelectorList
which contains a list of all Selector elements of the rule
- removed ``addSelector()`` and ``getSelectors()``,
use property ``selectorList`` instead
- removed ``getStyleDeclaration()`` and ``setStyleDeclaration()``,
use property ``style`` instead

- CSSStyleDeclaration:
- new constructor parameter ``cssText``

- moved ``SelectorList``, ``Selector`` and ``Property`` to own modules.
Should not be used directly yet anyway.

- Token: renamed ``IMPORTANT`` to ``IMPORTANT_SYM``

- unittests:
- added tests for CSSStyleSheet, CSSStyleRule, SelectorList, Selector
CSSStyleDeclaration, _Property

0.9a3

- refined EasyInstall (still some issues to be done)
- CSSCharsetRule serialized and parsed according to spec only as ``charset "ENCODING";`` so no comments allowed, only one space before encoding string which MUST use ``"`` as delimiter (see http://www.w3.org/TR/CSS21/syndata.html#q23)
NOT COMPLETE YET, E.G. BOM HANDLING

- added tests for setting empty cssText for all rules and CSSStyleRule
- bugfixes
- CSSStyleDeclaration: Of two Properties if written directly after another``a:1;b:2`` one was swallowed
- CSSSerializer:
added new class cssutils.serialize.Preferences to control output or CSSSerializer

0.9a2

- using setuptools for deployment
- new script ``cssparse`` which pprints css "filename"

- subpackages ``css`` and ``stylesheets`` are directly available from ``cssutils`` now
- renamed module ``cssutils.cssparser`` to ``cssutils.parse`` which should not be used directly anyway. Always use ``cssutils.CSSParser`` or ``cssutils.parse`` (s.b)
- added utility functions ``parse(cssText)`` and ``parse(filename, encoding='utf-8')`` to cssutils main package which work like the CSSParser functions with the same name and API
- return value of ``.cssText`` is ``u''`` and not ``None`` if empty now

- serializing
- cssutils.Serializer renamed to cssutils.CSSSerializer to improve usage of
``from cssutils import *``
- cssutils has a property "ser" which is used by all classes to serialize themselves
it is definable with a custom instance of cssutils.Serializer by setting
cssutils.setCSSSerializer(newserializer)

- prefs['CSSImportrule.href format'] may be set to
- 'uri': renders url(...) (default)
- 'string': renders "..."
- None: renders as set in CSSImportRule.hreftype

- css.CSSCharsetRule:
- improved parsing
- fixed API handling (setting of encoding did not work)

- css.CSSImportRule:
- improved parsing

- usage of \*.getFormatted emits DeprecationWarning now and returns \*.cssText

- lots of bugfixes and refactoring of modules, classes
- extension and refactoring of unittests

Page 19 of 21

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.