css-parser 1.1.0__tar.gz → 1.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. {css_parser-1.1.0/src/css_parser.egg-info → css_parser-1.1.1}/PKG-INFO +1 -1
  2. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_serialize.py +14 -0
  3. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/__init__.py +1 -1
  4. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/serialize.py +3 -0
  5. {css_parser-1.1.0 → css_parser-1.1.1/src/css_parser.egg-info}/PKG-INFO +1 -1
  6. {css_parser-1.1.0 → css_parser-1.1.1}/COPYING +0 -0
  7. {css_parser-1.1.0 → css_parser-1.1.1}/COPYING.LESSER +0 -0
  8. {css_parser-1.1.0 → css_parser-1.1.1}/MANIFEST.in +0 -0
  9. {css_parser-1.1.0 → css_parser-1.1.1}/README.md +0 -0
  10. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/__init__.py +0 -0
  11. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/basetest.py +0 -0
  12. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/096.css +0 -0
  13. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/097.css +0 -0
  14. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/1.css +0 -0
  15. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/1ascii.css +0 -0
  16. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/1import.css +0 -0
  17. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/1inherit-ascii.css +0 -0
  18. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/1inherit-iso.css +0 -0
  19. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/1inherit-utf8.css +0 -0
  20. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/1utf.css +0 -0
  21. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/2inherit-iso.css +0 -0
  22. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/2resolve.css +0 -0
  23. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/acid2.css +0 -0
  24. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/all.css +0 -0
  25. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/atrule.css +0 -0
  26. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/bad.css +0 -0
  27. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/basic.css +0 -0
  28. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/bundle.css +0 -0
  29. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/cases.css +0 -0
  30. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/csscombine-1.css +0 -0
  31. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/csscombine-2.css +0 -0
  32. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/csscombine-proxy.css +0 -0
  33. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/cthedot_default.css +0 -0
  34. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/default_html4.css +0 -0
  35. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/hacks.css +0 -0
  36. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/html.css +0 -0
  37. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/html20.css +0 -0
  38. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/html40.css +0 -0
  39. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/import/import-impossible.css +0 -0
  40. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/import/import2.css +0 -0
  41. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/import.css +0 -0
  42. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/import3.css +0 -0
  43. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/ll.css +0 -0
  44. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/ll2.css +0 -0
  45. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/multiple-values.css +0 -0
  46. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/page_test.css +0 -0
  47. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/sample_5.css +0 -0
  48. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/sample_7.css +0 -0
  49. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/simple.css +0 -0
  50. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/single-color.css +0 -0
  51. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/slashcode.css +0 -0
  52. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/t-HACKS.css +0 -0
  53. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/test-unicode.css +0 -0
  54. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/test.css +0 -0
  55. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/tigris.css +0 -0
  56. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/tigris2.css +0 -0
  57. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/u_simple.css +0 -0
  58. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/v_simple.css +0 -0
  59. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/var/start.css +0 -0
  60. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/var/use.css +0 -0
  61. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/var/vars.css +0 -0
  62. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/var/vars2.css +0 -0
  63. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/vars.css +0 -0
  64. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/varsimport.css +0 -0
  65. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/xhtml2.css +0 -0
  66. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/xhtml22.css +0 -0
  67. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/sheets/yuck.css +0 -0
  68. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_codec.py +0 -0
  69. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_csscharsetrule.py +0 -0
  70. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_csscomment.py +0 -0
  71. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssfontfacerule.py +0 -0
  72. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssimportrule.py +0 -0
  73. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssmediarule.py +0 -0
  74. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssnamespacerule.py +0 -0
  75. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_csspagerule.py +0 -0
  76. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssproperties.py +0 -0
  77. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssrule.py +0 -0
  78. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssrulelist.py +0 -0
  79. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssstyledeclaration.py +0 -0
  80. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssstylerule.py +0 -0
  81. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssstylesheet.py +0 -0
  82. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssunknownrule.py +0 -0
  83. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssutils.py +0 -0
  84. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssutilsimport.py +0 -0
  85. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssvalue.py +0 -0
  86. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssvariablesdeclaration.py +0 -0
  87. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_cssvariablesrule.py +0 -0
  88. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_domimplementation.py +0 -0
  89. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_encutils.py +0 -0
  90. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_errorhandler.py +0 -0
  91. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_helper.py +0 -0
  92. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_marginrule.py +0 -0
  93. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_medialist.py +0 -0
  94. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_mediaquery.py +0 -0
  95. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_parse.py +0 -0
  96. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_prodparser.py +0 -0
  97. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_profiles.py +0 -0
  98. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_properties.py +0 -0
  99. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_property.py +0 -0
  100. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_scripts_csscombine.py +0 -0
  101. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_selector.py +0 -0
  102. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_selectorlist.py +0 -0
  103. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_settings.py +0 -0
  104. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_stylesheet.py +0 -0
  105. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_tokenize2.py +0 -0
  106. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_util.py +0 -0
  107. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_value.py +0 -0
  108. {css_parser-1.1.0 → css_parser-1.1.1}/css_parser_tests/test_x.py +0 -0
  109. {css_parser-1.1.0 → css_parser-1.1.1}/pyproject.toml +0 -0
  110. {css_parser-1.1.0 → css_parser-1.1.1}/run_tests.py +0 -0
  111. {css_parser-1.1.0 → css_parser-1.1.1}/setup.cfg +0 -0
  112. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/_fetch.py +0 -0
  113. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/_fetchgae.py +0 -0
  114. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/codec.py +0 -0
  115. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/__init__.py +0 -0
  116. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/colors.py +0 -0
  117. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/csscharsetrule.py +0 -0
  118. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/csscomment.py +0 -0
  119. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssfontfacerule.py +0 -0
  120. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssimportrule.py +0 -0
  121. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssmediarule.py +0 -0
  122. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssnamespacerule.py +0 -0
  123. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/csspagerule.py +0 -0
  124. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssproperties.py +0 -0
  125. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssrule.py +0 -0
  126. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssrulelist.py +0 -0
  127. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssstyledeclaration.py +0 -0
  128. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssstylerule.py +0 -0
  129. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssstylesheet.py +0 -0
  130. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssunknownrule.py +0 -0
  131. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssvalue.py +0 -0
  132. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssvariablesdeclaration.py +0 -0
  133. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/cssvariablesrule.py +0 -0
  134. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/marginrule.py +0 -0
  135. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/property.py +0 -0
  136. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/selector.py +0 -0
  137. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/selectorlist.py +0 -0
  138. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/css/value.py +0 -0
  139. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/cssproductions.py +0 -0
  140. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/encutils/__init__.py +0 -0
  141. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/errorhandler.py +0 -0
  142. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/helper.py +0 -0
  143. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/parse.py +0 -0
  144. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/prodparser.py +0 -0
  145. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/profiles.py +0 -0
  146. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/sac.py +0 -0
  147. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/script.py +0 -0
  148. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/scripts/__init__.py +0 -0
  149. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/scripts/csscapture.py +0 -0
  150. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/scripts/csscombine.py +0 -0
  151. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/scripts/cssparse.py +0 -0
  152. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/settings.py +0 -0
  153. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/stylesheets/__init__.py +0 -0
  154. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/stylesheets/medialist.py +0 -0
  155. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/stylesheets/mediaquery.py +0 -0
  156. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/stylesheets/stylesheet.py +0 -0
  157. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/stylesheets/stylesheetlist.py +0 -0
  158. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/tokenize2.py +0 -0
  159. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser/util.py +0 -0
  160. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser.egg-info/SOURCES.txt +0 -0
  161. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser.egg-info/dependency_links.txt +0 -0
  162. {css_parser-1.1.0 → css_parser-1.1.1}/src/css_parser.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: css-parser
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: A CSS Cascading Style Sheets library for Python
5
5
  Author-email: Various People <redacted@anonymous.net>
6
6
  License-Expression: LGPL-3.0-or-later
@@ -142,6 +142,20 @@ prefix|x, a + b > c ~ d, b {
142
142
  s = css_parser.parseString('a{x:%s}' % test)
143
143
  self.assertEqual(('a {\n x: %s\n }' % exp).encode(), s.cssText)
144
144
 
145
+ def test_level4_selector_serialization(self):
146
+ for test, expected in {
147
+ 'p:has(+ p)': 'p:has(+ p)',
148
+ '.p:has(+ .p)': '.p:has(+ .p)',
149
+ }.items():
150
+ css_parser.ser.prefs.useDefaults()
151
+ s = css_parser.parseString(f'{test} {{ color: red }}')
152
+ actual = s.cssText.decode()
153
+ self.assertEqual(expected, actual[:actual.index('{')].strip(), f'for selector: {test}')
154
+ css_parser.ser.prefs.useMinified()
155
+ s = css_parser.parseString(f'{test} {{ color: red }}')
156
+ actual = s.cssText.decode()
157
+ self.assertEqual(expected.replace(' ', ''), actual[:actual.index('{')].strip(), f'minified: for selector: {test}')
158
+
145
159
  def test_useMinified(self):
146
160
  "Preferences.useMinified()"
147
161
  css_parser.ser.prefs.useDefaults()
@@ -11,7 +11,7 @@ from .parse import CSSParser
11
11
  from .profiles import Profiles
12
12
  from .serialize import CSSSerializer
13
13
 
14
- __version__ = '1.1.0'
14
+ __version__ = '1.1.1'
15
15
  VERSION = __version__
16
16
 
17
17
  """css_parser - CSS Cascading Style Sheets library for Python
@@ -855,6 +855,9 @@ class CSSSerializer(object):
855
855
  text = sel.selectorText
856
856
  if text.startswith('* '):
857
857
  text = text[2:]
858
+ elif text.startswith(('*+', '*>', '*~')):
859
+ # Handle minified case where * is directly adjacent to combinator
860
+ text = text[1:]
858
861
  parts.append(text)
859
862
  sep = ',%s' % self.prefs.listItemSpacer
860
863
  inner = sep.join(parts)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: css-parser
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: A CSS Cascading Style Sheets library for Python
5
5
  Author-email: Various People <redacted@anonymous.net>
6
6
  License-Expression: LGPL-3.0-or-later
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes