<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>119373</bug_id>
          
          <creation_ts>2006-01-02 11:04:21 +0000</creation_ts>
          <short_desc>CSS class autocompletion does not ignore selectors</short_desc>
          <delta_ts>2006-01-11 11:15:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>quanta</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Rolf Eike Beer">kde</reporter>
          <assigned_to name="András Manţia">amantia</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>403033</commentid>
    <comment_count>0</comment_count>
    <who name="Rolf Eike Beer">kde</who>
    <bug_when>2006-01-02 11:04:21 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.0)
Installed from:    SuSE RPMs

If you type &apos;class&apos; for one element the autocompletion shows up. If there are CSS classes defined with :selector quanta does not ignore them. You can test by adding this to the header of a new HTML document:

&lt;style type=&quot;text/css&quot;&gt;
li.special:before {}
li.special:after {}
li.foo :before {}
li.foo :after {}
&lt;/style&gt;

If you add a new &lt;li&gt; there should only be two valid classes to select: &quot;special&quot; and &quot;foo&quot;. Instead there are &quot;special:before&quot;, &quot;special:after&quot;, &quot;foo&quot;, &quot;foo:before&quot; and &quot;foo:after&quot; but no &quot;special&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>403518</commentid>
    <comment_count>1</comment_count>
    <who name="Rolf Eike Beer">kde</who>
    <bug_when>2006-01-04 14:01:35 +0000</bug_when>
    <thetext>As I was told the second example is wrong, there must not be whitespace before the colon. Nevertheless the bug still is there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405006</commentid>
    <comment_count>2</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2006-01-10 15:31:21 +0000</bug_when>
    <thetext>I have a question (I am not a web developer...). In case of 
&lt;style type=&quot;text/css&quot;&gt;
  li.special:before {}
  li.special:after {}
  li.foo:before {}
  li.foo:after {}
 A:link    { color: red }
 A:active  { color: blue; font-size: 125% }
 A:visited { color: green; font-size: 85% }
&lt;/style&gt;

&lt;li class=&quot;&quot;&gt;
&lt;a class=&quot;&quot;&gt;&lt;/a&gt;


What *exactly* should appear for the li class and for the a class?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405009</commentid>
    <comment_count>3</comment_count>
    <who name="Rolf Eike Beer">kde</who>
    <bug_when>2006-01-10 15:34:02 +0000</bug_when>
    <thetext>For &lt;li&gt; there should be the choices &quot;special&quot; and &quot;foo&quot;, for &lt;a&gt; none.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405011</commentid>
    <comment_count>4</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2006-01-10 15:50:27 +0000</bug_when>
    <thetext>Ok, then modify the $KDEDIR/share/apps/quanta/dtep/cdd/description.rc 
file so under [StructGroup_1] you replace the DefinitionRx line with 
this:

DefinitionRx = \s([\d\S\w]+):.*\b

Please report if you find some problem with this version related CSS 
selectors/class autocompletion.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405204</commentid>
    <comment_count>5</comment_count>
    <who name="Rolf Eike Beer">kde</who>
    <bug_when>2006-01-11 09:36:10 +0000</bug_when>
    <thetext>Now I don&apos;t get any autocompletion at all.

It&apos;s not .../dtep/cdd/... but .../dtep/css/..., isn&apos;t it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405215</commentid>
    <comment_count>6</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2006-01-11 10:22:05 +0000</bug_when>
    <thetext>On Wednesday 11 January 2006 10:36, Rolf Eike Beer wrote:
&gt; Now I don&apos;t get any autocompletion at all.


That&apos;s strange, as for the example I pasted, I get foo and special for 
&lt;li&gt; and nothing for &lt;a&gt;.
Did you put in the global KDE folder (on 
suse /opt/kde3/share/apps/quanta/dtep/css)? I also have suse, although 
I&apos;m using a self compiled KDE.

Anyway, i attach the version I have to test.

&gt; It&apos;s not .../dtep/cdd/... but .../dtep/css/..., isn&apos;t it?



Yes, of course, I misstyped it.

Andras


Created an attachment (id=14207)
description.rc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405218</commentid>
    <comment_count>7</comment_count>
    <who name="Rolf Eike Beer">kde</who>
    <bug_when>2006-01-11 10:26:59 +0000</bug_when>
    <thetext>Ah, I found the problem. I used a different example. Now autocompletion does not show up if the defined CSS does _not_ use selectors.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405225</commentid>
    <comment_count>8</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2006-01-11 11:08:26 +0000</bug_when>
    <thetext>SVN commit 496777 by amantia:

Don&apos;t show CSS pseudo-classes/elements in autocompletion for the class attribute.

BUG: 119373

 M  +2 -1      ChangeLog  
 M  +8 -2      src/dcopquanta.cpp  


--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #496776:496777
@@ -1,6 +1,6 @@
 This files contains the changes since Quanta 2.0 until the current 3.5.x series.
 
-Version 3.5.1 (Release date: 29-11-2005; Started 04-03-2004):
+Version 3.5.1 (Release date: xx-01-2006; Started 30-29-2005):
  - bugfixes:
         - better handling of quotation marks when editing tags inside a script area [#118693]
         - don&apos;t show the file changed dialog after using save as and save again
@@ -10,6 +10,7 @@
         - don&apos;t show the Pages tab in DTEP editing dialog more than once [#118840]
         - set the DTEP of the document to the one selected in the Quick Start dialog [#118814]
         - don&apos;t have two Close actions [#118448]
+        - don&apos;t show CSS pseudo-classes in autocompletion for the class attribute [#119373]
 
  - improvements:
         - add XHTML 1.1 and XHTML 1.0 Basic to the quickstart dialog [#118813]
--- branches/KDE/3.5/kdewebdev/quanta/src/dcopquanta.cpp #496776:496777
@@ -31,6 +31,7 @@
 
 QStringList DCOPQuanta::selectors(const QString&amp; tag)
 {
+  const QRegExp rx(&quot;\\.|\\#|\\:&quot;);
   QStringList selectorList;
   GroupElementMapList::Iterator it;
   for ( it = globalGroupMap.begin(); it != globalGroupMap.end(); ++it )
@@ -39,8 +40,11 @@
     if (key.startsWith(&quot;Selectors|&quot;))
     {
       QString selectorName = key.mid(10);
+      int index = selectorName.find(&apos;:&apos;);
+      if (index != -1)
+        selectorName = selectorName.mid(0, index);
       QString tmpStr;
-      int index = selectorName.find(QRegExp(&quot;\\.|\\#|\\:&quot;));
+      index = selectorName.find(rx);
       if (index != -1)
       {
         tmpStr = selectorName.left(index).lower();
@@ -50,7 +54,9 @@
       }
       if (tmpStr.isEmpty() || tag.lower() == tmpStr || tmpStr == &quot;*&quot;)
       {
-        selectorList &lt;&lt; selectorName.mid(index + 1).replace(&apos;.&apos;,&apos; &apos;);
+        tmpStr = selectorName.mid(index + 1).replace(&apos;.&apos;,&apos; &apos;);
+        if (!tmpStr.isEmpty() &amp;&amp; !selectorList.contains(tmpStr))
+          selectorList &lt;&lt; tmpStr;
       }
      }
   }
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405226</commentid>
    <comment_count>9</comment_count>
    <who name="András Manţia">amantia</who>
    <bug_when>2006-01-11 11:12:52 +0000</bug_when>
    <thetext>Unfortunately it seems the problem cannot be solved in a good way with 
the regular expression only, so I needed some code change as well. The 
fix will be in 3.5.1, if you want it sooner, see my commit message 
(soon it will be forwarded to the bug as well).
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>405230</commentid>
    <comment_count>10</comment_count>
    <who name="Rolf Eike Beer">kde</who>
    <bug_when>2006-01-11 11:15:21 +0000</bug_when>
    <thetext>Thx</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>14207</attachid>
            <date>2006-01-11 10:22:05 +0000</date>
            <delta_ts>2006-01-11 10:22:05 +0000</delta_ts>
            <desc>description.rc</desc>
            <filename>description.rc</filename>
            <type>text/plain</type>
            <size>653</size>
            <attacher name="András Manţia">amantia</attacher>
            
              <data encoding="base64">W0dlbmVyYWxdCk5hbWUgPSB0ZXh0L2NzcwpOaWNrTmFtZSA9IENTUwpEZWZhdWx0RXh0ZW5zaW9u
ID0gY3NzCk1pbWVUeXBlcyA9IHRleHQvY3NzCk51bU9mUGFnZXMgPSAwCkNhc2VTZW5zaXRpdmUg
PSB0cnVlCkZhbWlseSA9IDIKVG9wTGV2ZWwgPSB0cnVlCgpbVG9vbGJhcnNdCkxvY2F0aW9uID0g
Y3NzCk5hbWVzID0gY3NzCgpbRXh0cmEgcnVsZXNdClN0cnVjdEdyb3Vwc0NvdW50ID0gMQpNaW51
c0FsbG93ZWRJbldvcmQgPSB0cnVlClRhZ0F1dG9Db21wbGV0ZUFmdGVyID0gewpSZXF1ZXN0U3Bh
Y2VCZWZvcmVUYWdBdXRvQ29tcGxldGlvbiA9IHRydWUKQXR0cmlidXRlQXV0b0NvbXBsZXRlQWZ0
ZXIgPSA6CkF0dHJpYnV0ZVNlcGFyYXRvciA9ICwKVGFnU2VwYXJhdG9yID0gOwoKW1BhcnNpbmcg
cnVsZXNdClRhZ3MgPSBzdHlsZSh0eXBlW3RleHQvY3NzXSkKQ29tbWVudHMgPSAvKiAqLwpTdHJ1
Y3RLZXl3b3JkcyA9ClN0cnVjdEJlZ2luU3RyID0gewpTdHJ1Y3RFbmRTdHIgPSB9ClN0cnVjdFJ4
ID0gXFx7fFxcfQoKCltTdHJ1Y3RHcm91cF8xXQpOYW1lID0gU2VsZWN0b3JzCk5vX05hbWUgPSBO
byBTZWxlY3RvcnMgRm91bmQKRGVmaW5pdGlvblJ4ID0gXHMoW1xkXFNcd10rKTouKlxiClRhZ1R5
cGUgPSBTY3JpcHRTdHJ1Y3R1cmVCZWdpbgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>