<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 84: Comments handling in CSSParser Vs Browser behavior differs</title><link href="https://sourceforge.net/p/cssparser/bugs/84/" rel="alternate"/><link href="https://sourceforge.net/p/cssparser/bugs/84/feed.atom" rel="self"/><id>https://sourceforge.net/p/cssparser/bugs/84/</id><updated>2017-12-03T19:10:39Z</updated><subtitle>Recent changes to 84: Comments handling in CSSParser Vs Browser behavior differs</subtitle><entry><title>#84 Comments handling in CSSParser Vs Browser behavior differs</title><link href="https://sourceforge.net/p/cssparser/bugs/84/?limit=25#50cd" rel="alternate"/><published>2017-12-03T19:10:39Z</published><updated>2017-12-03T19:10:39Z</updated><author><name>RBRi</name><uri>https://sourceforge.net/u/rbri/</uri></author><id>https://sourceforge.net45b4173ec5f74c3bae7e3eacb8960db32077a150</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Will have a look and try to fix it.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Comments handling in CSSParser Vs Browser behavior differs</title><link href="https://sourceforge.net/p/cssparser/bugs/84/" rel="alternate"/><published>2017-11-27T06:44:28.652000Z</published><updated>2017-11-27T06:44:28.652000Z</updated><author><name>Asiya</name><uri>https://sourceforge.net/u/fabian12/</uri></author><id>https://sourceforge.netd30e50532b3508c789dd2b8a691246090707737c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;Comments handling in CSSParser Vs Browser behavior&lt;br/&gt;
&lt;/strong&gt;&lt;br/&gt;
CSS uses the"block comment" syntax (ie., start a comment with /, and end it with /) and don't support "line comment" //&lt;/p&gt;
&lt;p&gt;Whenever we use // in CSS, the next CSS construct - either declaration or block - will be "commented out" in browser .&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CASE 1 :&lt;br/&gt;
&lt;/strong&gt;&lt;br/&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br/&gt;
&amp;lt;html&amp;gt;&lt;br/&gt;
&amp;lt;head&amp;gt;&lt;br/&gt;
&amp;lt;style&amp;gt;&lt;br/&gt;
//comment here&lt;br/&gt;
.foo {&lt;br/&gt;
width: auto;&lt;br/&gt;
height: 500px;&lt;br/&gt;
background: yellow;&lt;br/&gt;
color:red;&lt;br/&gt;
}&lt;br/&gt;
&amp;lt;/style&amp;gt;&lt;br/&gt;
&amp;lt;/head&amp;gt;&lt;br/&gt;
&amp;lt;body&amp;gt;&lt;/p&gt;
&lt;p&gt;Hello World!&lt;/p&gt;
&lt;p&gt;&amp;lt;/body&amp;gt;&lt;br/&gt;
&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;p&gt;Browser behavior - Style with class "foo" will be commented out&lt;br/&gt;
CSS parser behavior - Style with class "foo" will be striped out&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CASE 2 :&lt;br/&gt;
&lt;/strong&gt;&lt;br/&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br/&gt;
&amp;lt;html&amp;gt;&lt;br/&gt;
&amp;lt;head&amp;gt;&lt;br/&gt;
&amp;lt;style&amp;gt;&lt;br/&gt;
.foo {&lt;br/&gt;
width: auto;&lt;br/&gt;
//comments here&lt;br/&gt;
height: 500px;&lt;br/&gt;
background: yellow;&lt;br/&gt;
color:red;&lt;br/&gt;
}&lt;br/&gt;
&amp;lt;/style&amp;gt;&lt;br/&gt;
&amp;lt;/head&amp;gt;&lt;br/&gt;
&amp;lt;body&amp;gt;&lt;/p&gt;
&lt;p&gt;Hello World!&lt;/p&gt;
&lt;p&gt;&amp;lt;/body&amp;gt;&lt;br/&gt;
&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;p&gt;Browser behavior - In the above Style declarations "height: 500px; background: yellow;color:red;" will be commented out&lt;br/&gt;
CSS parser behavior - In the above Style declarations "height: 500px; background: yellow;color:red;" will be striped out&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CASE 3 :&lt;br/&gt;
&lt;/strong&gt;&lt;br/&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br/&gt;
&amp;lt;html&amp;gt;&lt;br/&gt;
&amp;lt;head&amp;gt;&lt;br/&gt;
&amp;lt;style&amp;gt;&lt;br/&gt;
.foo {&lt;br/&gt;
width: auto;&lt;br/&gt;
//height: 500px;&lt;br/&gt;
background: yellow;&lt;br/&gt;
color:red;&lt;br/&gt;
}&lt;br/&gt;
&amp;lt;/style&amp;gt;&lt;br/&gt;
&amp;lt;/head&amp;gt;&lt;br/&gt;
&amp;lt;body&amp;gt;&lt;/p&gt;
&lt;p&gt;Hello World!&lt;/p&gt;
&lt;p&gt;&amp;lt;/body&amp;gt;&lt;br/&gt;
&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;p&gt;Browser behavior - In this case, //height: will be consider as invalid css property, hence "background: yellow; color:red;" will be applied in browser&lt;/p&gt;
&lt;p&gt;CSS parser behavior - In the above Style declarations "height: 500px; background: yellow;color:red;" will be striped out&lt;/p&gt;
&lt;p&gt;In CASE3, The browser and parser behavior differs. Is there any way to handle it ?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>