<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 87: CSS3 parsing of :not(X) , :nth-child(X) arguments incomplete</title><link href="https://sourceforge.net/p/cssparser/bugs/87/" rel="alternate"/><link href="https://sourceforge.net/p/cssparser/bugs/87/feed.atom" rel="self"/><id>https://sourceforge.net/p/cssparser/bugs/87/</id><updated>2019-06-30T05:37:22.294000Z</updated><subtitle>Recent changes to 87: CSS3 parsing of :not(X) , :nth-child(X) arguments incomplete</subtitle><entry><title>#87 CSS3 parsing of :not(X) , :nth-child(X) arguments incomplete</title><link href="https://sourceforge.net/p/cssparser/bugs/87/?limit=25#a2f7" rel="alternate"/><published>2019-06-30T05:37:22.294000Z</published><updated>2019-06-30T05:37:22.294000Z</updated><author><name>Jeremie Miserez</name><uri>https://sourceforge.net/u/jmiserez/</uri></author><id>https://sourceforge.net37b14d1585d331ab8b9ddc9bd33f1a592de45ba3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Updated the issue to better describe the problem.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#87 CSS3 parsing of :not(X) , :nth-child(X) arguments incomplete</title><link href="https://sourceforge.net/p/cssparser/bugs/87/?limit=25#e3d1" rel="alternate"/><published>2019-06-30T05:36:10.772000Z</published><updated>2019-06-30T05:36:10.772000Z</updated><author><name>Jeremie Miserez</name><uri>https://sourceforge.net/u/jmiserez/</uri></author><id>https://sourceforge.neta9cc4d0a79a258fc89d14ec257d971f05c103ed4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;summary&lt;/strong&gt;: Parsing of :not(X)  argument incomplete --&amp;gt; CSS3 parsing of :not(X) , :nth-child(X) arguments incomplete&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</summary></entry><entry><title>#87 Parsing of :not(X)  argument incomplete</title><link href="https://sourceforge.net/p/cssparser/bugs/87/?limit=25#5011" rel="alternate"/><published>2019-06-30T05:35:38.816000Z</published><updated>2019-06-30T05:35:38.816000Z</updated><author><name>Jeremie Miserez</name><uri>https://sourceforge.net/u/jmiserez/</uri></author><id>https://sourceforge.netd798b9736867cae66bcf6fbe98983f5beb2975ac</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;ul&gt;
&lt;li&gt;Description has changed:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Diff:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="gd"&gt;--- old&lt;/span&gt;
&lt;span class="gi"&gt;+++ new&lt;/span&gt;
&lt;span class="gu"&gt;@@ -1,9 +1,9 @@&lt;/span&gt;
&lt;span class="gd"&gt;-Parsing &amp;amp;#34;:not(FOO)&amp;amp;#34; results in a PseudoClassElementImpl with value &amp;amp;#34;not(FOO)&amp;amp;#34;, i.e. the argument itself is not parsed any further. This is both in SACParserCSS21 and SACParserCSS3.&lt;/span&gt;
&lt;span class="gi"&gt;+Parsing &amp;amp;#34;:not(FOO)&amp;amp;#34; or &amp;amp;#34;:nth-child(FOO)&amp;amp;#34; results in a PseudoClassConditionImpl with value &amp;amp;#34;not(FOO)&amp;amp;#34; or &amp;amp;#34;nth-child(FOO)&amp;amp;#34;, i.e. the argument itself is not parsed any further. This is in SACParserCSS3.&lt;/span&gt;

&lt;span class="gd"&gt;-This makes it impossible to differentiate between &amp;amp;#34;:not(#foo)&amp;amp;#34; and &amp;amp;#34;:not(.foo)&amp;amp;#34; without putting the argument string through second parser, i.e. the tree is incomplete.&lt;/span&gt;
&lt;span class="gi"&gt;+This makes it impossible to differentiate between &amp;amp;#34;:not(#foo)&amp;amp;#34; and &amp;amp;#34;:not(.foo)&amp;amp;#34; without putting the argument string through second parser, i.e. the tree is incomplete. I found this issue when calculating CSS selector specificity using the the current parsers: &amp;amp;#34;:not(#foo)&amp;amp;#34; and &amp;amp;#34;:not(.foo)&amp;amp;#34; return the same single SAC_PSEUDO_CLASS_CONDITION/PseudoClassConditionImpl, although their specifity is different (1-0-0 vs 0-1-0) and there could be more selectors inside.&lt;/span&gt;

&lt;span class="gd"&gt;-I found this issue when calculating CSS selector specificity using the the current parsers: &amp;amp;#34;:not(#foo)&amp;amp;#34; and &amp;amp;#34;:not(.foo)&amp;amp;#34; return the same single SAC_PSEUDO_CLASS_CONDITION/PseudoClassElementImpl, although their specifity is different (1-0-0 vs 0-1-0) and there could be more selectors inside.&lt;/span&gt;
&lt;span class="gi"&gt;+I guess the issue only is that CSS3 parsing/grammar is incomplete. I&amp;amp;#39;ll see if I can attach a patch, but it may take a while.&lt;/span&gt;

&lt;span class="gd"&gt;-See here for more about the negation pseudo-class: https://www.w3.org/TR/selectors-3/#negation&lt;/span&gt;
&lt;span class="gd"&gt;-&lt;/span&gt;
&lt;span class="gd"&gt;-This isn&amp;amp;#39;t critical, but the parser is still incorrect.&lt;/span&gt;
&lt;span class="gi"&gt;+See here for more:&lt;/span&gt;
&lt;span class="gi"&gt;+- https://www.w3.org/TR/selectors-3/#negation&lt;/span&gt;
&lt;span class="gi"&gt;+- https://www.w3.org/TR/selectors-3/#nth-child-pseudo &lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Parsing of :not(X)  argument incomplete</title><link href="https://sourceforge.net/p/cssparser/bugs/87/" rel="alternate"/><published>2019-06-29T11:17:44.158000Z</published><updated>2019-06-29T11:17:44.158000Z</updated><author><name>Jeremie Miserez</name><uri>https://sourceforge.net/u/jmiserez/</uri></author><id>https://sourceforge.net02f57e026a687b1915d4e97c70736e5095c394d3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Parsing ":not(FOO)" results in a PseudoClassElementImpl with value "not(FOO)", i.e. the argument itself is not parsed any further. This is both in SACParserCSS21 and SACParserCSS3.&lt;/p&gt;
&lt;p&gt;This makes it impossible to differentiate between ":not(#foo)" and ":not(.foo)" without putting the argument string through second parser, i.e. the tree is incomplete.&lt;/p&gt;
&lt;p&gt;I found this issue when calculating CSS selector specificity using the the current parsers: ":not(#foo)" and ":not(.foo)" return the same single SAC_PSEUDO_CLASS_CONDITION/PseudoClassElementImpl, although their specifity is different (1-0-0 vs 0-1-0) and there could be more selectors inside.&lt;/p&gt;
&lt;p&gt;See here for more about the negation pseudo-class: &lt;a href="https://www.w3.org/TR/selectors-3/#negation" rel="nofollow"&gt;https://www.w3.org/TR/selectors-3/#negation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This isn't critical, but the parser is still incorrect.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Parsing of :not(X)  argument incomplete</title><link href="https://sourceforge.net/p/cssparser/bugs/87/" rel="alternate"/><published>2019-06-29T11:17:44.158000Z</published><updated>2019-06-29T11:17:44.158000Z</updated><author><name>Jeremie Miserez</name><uri>https://sourceforge.net/u/jmiserez/</uri></author><id>https://sourceforge.net7d115c46ecd4a9870b61e3086c782a37e55bc0bf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ticket 87 has been modified: Parsing of :not(X)  argument incomplete&lt;br/&gt;
Edited By: Jeremie Miserez (jmiserez)&lt;br/&gt;
Description updated:&lt;br/&gt;
--- description-old&lt;/p&gt;
&lt;p&gt;+++ description-new&lt;/p&gt;
&lt;p&gt;@@ -1,9 +1,9 @@&lt;/p&gt;
&lt;p&gt;-Parsing ":not(FOO)" results in a PseudoClassElementImpl with value "not(FOO)", i.e. the argument itself is not parsed any further. This is both in SACParserCSS21 and SACParserCSS3.&lt;br/&gt;
+Parsing ":not(FOO)" or ":nth-child(FOO)" results in a PseudoClassConditionImpl with value "not(FOO)" or "nth-child(FOO)", i.e. the argument itself is not parsed any further. This is in SACParserCSS3.&lt;/p&gt;
&lt;p&gt;-This makes it impossible to differentiate between ":not(#foo)" and ":not(.foo)" without putting the argument string through second parser, i.e. the tree is incomplete.&lt;br/&gt;
+This makes it impossible to differentiate between ":not(#foo)" and ":not(.foo)" without putting the argument string through second parser, i.e. the tree is incomplete. I found this issue when calculating CSS selector specificity using the the current parsers: ":not(#foo)" and ":not(.foo)" return the same single SAC_PSEUDO_CLASS_CONDITION/PseudoClassConditionImpl, although their specifity is different (1-0-0 vs 0-1-0) and there could be more selectors inside.&lt;/p&gt;
&lt;p&gt;-I found this issue when calculating CSS selector specificity using the the current parsers: ":not(#foo)" and ":not(.foo)" return the same single SAC_PSEUDO_CLASS_CONDITION/PseudoClassElementImpl, although their specifity is different (1-0-0 vs 0-1-0) and there could be more selectors inside.&lt;br/&gt;
+I guess the issue only is that CSS3 parsing/grammar is incomplete. I'll see if I can attach a patch, but it may take a while.&lt;/p&gt;
&lt;h2 id="-see-here-for-more-about-the-negation-pseudo-class-httpswwww3orgtrselectors-3negation"&gt;-See here for more about the negation pseudo-class: &lt;a href="https://www.w3.org/TR/selectors-3/#negation" rel="nofollow"&gt;https://www.w3.org/TR/selectors-3/#negation&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;-This isn't critical, but the parser is still incorrect.&lt;br/&gt;
+See here for more:&lt;br/&gt;
+- &lt;a href="https://www.w3.org/TR/selectors-3/#negation" rel="nofollow"&gt;https://www.w3.org/TR/selectors-3/#negation&lt;/a&gt;&lt;br/&gt;
+- &lt;a href="https://www.w3.org/TR/selectors-3/#nth-child-pseudo" rel="nofollow"&gt;https://www.w3.org/TR/selectors-3/#nth-child-pseudo&lt;/a&gt; &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>CSS3 parsing of :not(X) , :nth-child(X) arguments incomplete</title><link href="https://sourceforge.net/p/cssparser/bugs/87/" rel="alternate"/><published>2019-06-29T11:17:44.158000Z</published><updated>2019-06-29T11:17:44.158000Z</updated><author><name>Jeremie Miserez</name><uri>https://sourceforge.net/u/jmiserez/</uri></author><id>https://sourceforge.netfa81bc753fed44cd66c7277f1058593e5cd8d776</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ticket 87 has been modified: CSS3 parsing of :not(X) , :nth-child(X) arguments incomplete&lt;br/&gt;
Edited By: Jeremie Miserez (jmiserez)&lt;br/&gt;
Summary updated: u'Parsing of :not(X)  argument incomplete' =&amp;gt; u'CSS3 parsing of :not(X) , :nth-child(X) arguments incomplete'&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>