This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 235575 - CSS editor did not fully detect whole id="" name from HTML editor
Summary: CSS editor did not fully detect whole id="" name from HTML editor
Status: RESOLVED WORKSFORME
Alias: None
Product: web
Classification: Unclassified
Component: CSS Editor (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-05 19:34 UTC by Neobean
Modified: 2014-07-28 14:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
an image showing a bug in the CSS editor completion (23.52 KB, image/png)
2013-09-18 20:51 UTC, Neobean
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Neobean 2013-09-05 19:34:43 UTC
Hi 

I'm sorry if I sound vague in the description of the issue I came across in this bug report.

As I described in the headline I had a problem with the CSS editor not fully detecting the whole id="here_is_my_very_long_id_name".

This example below will hopefully provide a better description of what the problem was.

Example:
<html>

<div id="here_is_my_very_long_id_name"></div>

</html>

The CSS:

#here_is_my_very_long_i_name {

}

The incident were very similar to the one in the above - as you can see I'm missing the letter "d" in id and that was exactly what happened !

I did pick the "here_is_my_very_long_id_name" from the code completion list in the CSS editor and the most scary part of it all was that I didn't receive any errors from the CSS editor nor the HTML editor !

The result was that I didn't understand why my webpage didn't change according to the changes I made in my HTML and CSS ! - it took me a few moments to figure out what the problem was, so I managed to save the day after all :o)

I have noticed that the CSS editor isn't always updating the id="name" or class="name" I make in my HTML right away, so maybe there is a minor issue hidden there ?

I hope I have been descriptive enough, in this my first bug report, so the developers can look into the problem.

Thank you in advance
Comment 1 Marek Fukala 2013-09-09 07:37:56 UTC
Hi,

By default, there's no error checking for the ids - you can enable it in the html editor options. It used to be enabled by default, but many people complained about lots of warning for missing id declaration in their applications which use element ids not for for styling, but for some application logic.

I'm not sure if I understand the exact problem. Are you saying you changed the id in the stylesheet, but the completion in html still offered the old value? In fact the completion offers both as it also offers the completed value itself:

<div id="foo|"/> ... the completion will offer the "foo" even if there's no declaration for it. So if you then create a rule #foo2 {} and invoke completion at the pipe offset again, it will offer both foo and foo2. Can this be the source of your problem?

Please confirm.

Thank you for the report.
Comment 2 Neobean 2013-09-09 16:14:25 UTC
(In reply to Marek Fukala from comment #1)

> 
> I'm not sure if I understand the exact problem. Are you saying you changed
> the id in the stylesheet, but the completion in html still offered the old
> value? In fact the completion offers both as it also offers the completed
> value itself:

No, it was a brand new id I made - ie. it's like the editor didn't get the whole id correct the first time and so it missed a character.

I also experienced that, once I make a series of ids or classes then all of them won't be carried over to the CSS editor completion immediately - my last incident where this happened I edited a class and turned it into four ids and only two of them could be seen in the CSS completion immediately thereafter.
 
> <div id="foo|"/> ... the completion will offer the "foo" even if there's no
> declaration for it. So if you then create a rule #foo2 {} and invoke
> completion at the pipe offset again, it will offer both foo and foo2. Can
> this be the source of your problem?

No, I don't think that this is the source to my problem.

Well, I hope I have been able to provide a little more information in order to clarify the issue.
Comment 3 Marek Fukala 2013-09-10 07:05:45 UTC
> No, it was a brand new id I made - ie. it's like the editor didn't get the
> whole id correct the first time and so it missed a character.
> 
> I also experienced that, once I make a series of ids or classes then all of
> them won't be carried over to the CSS editor completion immediately - my
> last incident where this happened I edited a class and turned it into four
> ids and only two of them could be seen in the CSS completion immediately
> thereafter.
I think both problems can be connected. As for the first problem - you likely wrote the id with the error first, end then corrected it, right? 

There might be an issue w/ the css content indexing which might cause similar symptoms. In the first case the content was indexed in the moment the incorrect id was present in the text, but from some reason not reindexed once you corrected it.

However if I'm not able to reproduce, I'm affraid this is hard to fix. Any chance for finding a reproducible case w/ exact steps to reproduce?
Comment 4 Neobean 2013-09-10 20:25:02 UTC
(In reply to Marek Fukala from comment #3)
> > No, it was a brand new id I made - ie. it's like the editor didn't get the
> > whole id correct the first time and so it missed a character.
> > 
> > I also experienced that, once I make a series of ids or classes then all of
> > them won't be carried over to the CSS editor completion immediately - my
> > last incident where this happened I edited a class and turned it into four
> > ids and only two of them could be seen in the CSS completion immediately
> > thereafter.
> I think both problems can be connected. As for the first problem - you
> likely wrote the id with the error first, end then corrected it, right? 

Well, now I doubt myself on this one - you explanation seems to be very plausible indeed, so until I encounter an/a issue/behaviour exactly like this again I'll conclude human error as the most likely culprit and not a bug. 

 
> There might be an issue w/ the css content indexing which might cause
> similar symptoms. In the first case the content was indexed in the moment
> the incorrect id was present in the text, but from some reason not reindexed
> once you corrected it.
> 
> However if I'm not able to reproduce, I'm affraid this is hard to fix. Any
> chance for finding a reproducible case w/ exact steps to reproduce?

This sounds very much plausible to me as I have experienced that the indexing of newly made IDs and Classes in the CSS editor completion can be a tad slow - it is very IMPORTANT for me to tell you that the CSS editor completion only seem to slow down in its speed of indexing when the list it has to keep updated gets long ie. if the list consists of more than 20+ items then it seems to begin slowing down and fail to instantly update.
Comment 5 Marek Fukala 2013-09-12 08:11:33 UTC
I tried to reproduce in bigger project, but still w/ no luck. It might depend on number of the html/css files, their structure and their dependencies.

Could you please also download a latest daily build of netbeans 7.4 and try it there? I work only w/ trunk builds so possibly sg. has been already fixed in 7.4 which could improve the behaviour.

Ideally attach your project here or send it to me privately so I have a better change to reproduce/fix.

If sending of the project is not possible, can you try to create a profiler snapshot of the ide when you experience the issue? To create the snapshot click to the NB box+clock icon in the toolbar - this will start the profiling and then click again when you want to stop it. Then save the snapshot and attach it here.
Comment 6 Marek Fukala 2013-09-12 11:39:21 UTC
Please also take a look at Bug 235870 [Weird behaviour of ID/CLASS completion in html tag attributes] I've just filled. This might also be a main/contributing factor of the confusion.
Comment 7 Neobean 2013-09-18 20:51:35 UTC
Created attachment 140229 [details]
an image showing a bug in the CSS editor completion

The image I have attached clearly shows the bug I described in my initial post - ie. the CSS editor completion sometimes fail to capture the whole id="name"
Comment 8 Marek Fukala 2014-07-28 14:45:57 UTC
I'm not able to reproduce the described problem when using external stylesheet. However the problem described in the issue 235870 I mentioned earlier still exists.