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 225334

Summary: Edit CSS Rule dialog should check if selector already exists
Product: web Reporter: Vladimir Riha <vriha>
Component: CSS Visual ToolsAssignee: Jan Stola <jstola>
Status: REOPENED ---    
Severity: normal CC: kganfield
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Vladimir Riha 2013-01-25 10:42:56 UTC
As I find typing short class selector faster than looking for it in the expanded list, I simply typed already existing selector and confirm it. As a result, the rule was inserted at the end of css file although there was already the same rule. Could there be a check and if target file already contains this rule, do not create it again? 


To reproduce:
- run html file
- invoke Edit CSS Rule dialog from Navigator and add some already defined class to element
=> target css contains 2 same rules


Product Version: NetBeans IDE 7.3 RC1 (Build 201301240957)
Java: 1.7.0_11; Java HotSpot(TM) Client VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_11-b21
System: Linux version 3.2.0-35-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Marek Fukala 2013-08-27 13:43:15 UTC
I cannot reproduce the behaviour - if the class already exists in selected stylesheet it is not added again. Please verify.
Comment 2 Vladimir Riha 2013-08-28 13:21:08 UTC
Still reproducible for me:
 - have css with class rule "test" and below ID rule "foo"
 - in HTML file, select e.g. body, right click and select Edit CSS Rules
 - type name of new class selector "test"
 - confirm
=> css file contains 2 same selectors



Product Version: NetBeans IDE Dev (Build 201308280001)
Updates: Updates available
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 3 Marek Fukala 2013-08-28 13:47:52 UTC
now I can reproduce, I'm sorry