Summary: | CSS class autocompletion does not ignore selectors | ||
---|---|---|---|
Product: | [Unmaintained] quanta | Reporter: | Rolf Eike Beer <kde> |
Component: | general | Assignee: | András Manţia <amantia> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | description.rc |
Description
Rolf Eike Beer
2006-01-02 11:04:21 UTC
As I was told the second example is wrong, there must not be whitespace before the colon. Nevertheless the bug still is there. I have a question (I am not a web developer...). In case of <style type="text/css"> 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% } </style> <li class=""> <a class=""></a> What *exactly* should appear for the li class and for the a class? For <li> there should be the choices "special" and "foo", for <a> none. 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. Now I don't get any autocompletion at all. It's not .../dtep/cdd/... but .../dtep/css/..., isn't it? On Wednesday 11 January 2006 10:36, Rolf Eike Beer wrote: > Now I don't get any autocompletion at all. That's strange, as for the example I pasted, I get foo and special for <li> and nothing for <a>. Did you put in the global KDE folder (on suse /opt/kde3/share/apps/quanta/dtep/css)? I also have suse, although I'm using a self compiled KDE. Anyway, i attach the version I have to test. > It's not .../dtep/cdd/... but .../dtep/css/..., isn't it? Yes, of course, I misstyped it. Andras Created an attachment (id=14207) description.rc Ah, I found the problem. I used a different example. Now autocompletion does not show up if the defined CSS does _not_ use selectors. SVN commit 496777 by amantia: Don'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't show the file changed dialog after using save as and save again @@ -10,6 +10,7 @@ - don'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't have two Close actions [#118448] + - don'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& tag) { + const QRegExp rx("\\.|\\#|\\:"); QStringList selectorList; GroupElementMapList::Iterator it; for ( it = globalGroupMap.begin(); it != globalGroupMap.end(); ++it ) @@ -39,8 +40,11 @@ if (key.startsWith("Selectors|")) { QString selectorName = key.mid(10); + int index = selectorName.find(':'); + if (index != -1) + selectorName = selectorName.mid(0, index); QString tmpStr; - int index = selectorName.find(QRegExp("\\.|\\#|\\:")); + index = selectorName.find(rx); if (index != -1) { tmpStr = selectorName.left(index).lower(); @@ -50,7 +54,9 @@ } if (tmpStr.isEmpty() || tag.lower() == tmpStr || tmpStr == "*") { - selectorList << selectorName.mid(index + 1).replace('.',' '); + tmpStr = selectorName.mid(index + 1).replace('.',' '); + if (!tmpStr.isEmpty() && !selectorList.contains(tmpStr)) + selectorList << tmpStr; } } } 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). Thx |