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 218998 - modify rules doesn't do anything for dynamic element
Summary: modify rules doesn't do anything for dynamic element
Status: NEW
Alias: None
Product: web
Classification: Unclassified
Component: CSS Visual Tools (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Jan Stola
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-25 15:16 UTC by John Jullion-ceccarelli
Modified: 2014-10-06 13:27 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Jullion-ceccarelli 2012-09-25 15:16:22 UTC
Run the angrybids demo and select a dynamically generated element in the Nav, like .product-wrapper div. Right-click and choose Modify Rules. Nothing happens. Doing this on one of the static elements does open the dialog box.
Comment 1 Marek Fukala 2012-09-25 16:30:40 UTC
Modify Rules is meant just for source editing so the bug actually is that it is enabled for the "dynamic nodes" -> html.navigator.

OTOH we could possibly do something similar also for the dynamic elements - via the webkit API (if possible - ccing Honzas). Although in such case the changes would be just temporary as not persisted anywhere. Do we need/want this?
Comment 2 John Jullion-ceccarelli 2012-09-25 16:49:48 UTC
But why can't I use this dialog box to define CSS rules for dynamically generated DOM elements? Why wouldn't they be persisted? Wouldn't we just be writing the CSS rule to file?
Comment 3 Marek Fukala 2012-09-25 17:57:25 UTC
Primarily the "Modify Rules" action and the dialog is aimed for association of html element with existing css rule, either class or id. It adds class or id attribute to the element's source.

It can also create the rule in a selected stylesheet if it doesn't exist, but it will be empty and you need the RuleEditor to actually add content to the created rule. So for css rules creation I'd primarily use the RuleEditor.

So for the DOM-only elements there's no place where to store the class or id attributes and hence just a part (secondary) of the functionality would work.

Does that make some sense? I understand one may look at it from a different point of view and thus have expectations like you have.
Comment 4 Petr Jiricka 2012-09-25 18:55:20 UTC
Yes, I think it would still make sense to allow this, even if it's just for a part of the functionality. In that case, I guess the Selector field should be read-only. And one of the selector type may need to be disabled if either class or id are not present on the element.

BTW, in the scenario when I only want to create the rule without changing the element itself, I discovered bug 219016.
Comment 5 Marek Fukala 2012-10-31 18:19:32 UTC
Should be done to 7.3 still, though this can hardly be considered as bug.
Comment 6 Marek Fukala 2013-08-28 09:52:12 UTC
still works bad in 7.4 using DOM view - the action is enabled for dynamic elements, but then the changes are applied to the closest static element found.