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 246134 - CSS Styles window repopulating in endless loop
Summary: CSS Styles window repopulating in endless loop
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: CSS Visual Tools (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal (vote)
Assignee: Jan Stola
URL:
Keywords:
: 247092 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-30 13:29 UTC by Vladimir Riha
Modified: 2015-07-30 01:23 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screencast (2.95 MB, video/ogg)
2014-07-30 13:29 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2014-07-30 13:29:51 UTC
Created attachment 148415 [details]
screencast

Please try following:
  - create ResponseRabbits sample project
  - run it in Chrome with NB integration
  - turn on inspect mode
  - in CSS Styles window, switch to Document
  - expand for instance the 1st css file node
  - click on any css rule
  - click on another css rule

=> CSS Style window is repopulating by itself, the only way to get it working back again is to restart IDE.

See the attached screencast for reference


Product Version: NetBeans IDE Dev (Build web-main-1110-on-20140730)
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)
Comment 1 Jan Stola 2014-07-31 09:03:15 UTC
This issue is not specific to page inspection. It can be reproduced using the following steps (that do not run any page in any browser).

1. Open CSS Styles view (using Window > Web > CSS Styles view)
2. Open index.html from ResponsiveRabbits sample project in Editor
   => the context of CSS Styles view is set to index.html
   => Document tab appears in CSS Styles view
3. Select the Document tab in CSS Styles view.
4. Expand css/bootstrap.css node.
5. Click on the first rule/child of the expanded node.
6. Click on the second rule/child of the expanded node.
   => the selection will jump between these two nodes

If you click on any other node then this node joins the "selection dance party" ;-).
Comment 2 Vladimir Riha 2014-09-15 06:18:25 UTC
*** Bug 247092 has been marked as a duplicate of this bug. ***
Comment 3 Jan Stola 2015-07-28 12:47:04 UTC
When a new rule is set through RuleEditorController then two calls are made: setModel() followed by setRule(). When setModel() is invoked then the rule that corresponds to the old selected rule (in the old model) is found and is selected. Unfortunately, this generates a rule-change event. Next the setRule() is invoked and the selected rule is set correctly to the desired value. Then the unfortunate event is processed and results in another invocation of setModel() and setRule() methods (with the old rule) etc.

Schematically (rule A is the selected rule at the beginning):
* selectRule(B) is invoked
* setModel() -> A selected event fired
* setRule(B) -> rule B is selected, B selected event fired
* A selected event processed i.e. selectRule(A) is invoked
* setModel() -> B selected event fired (as B is the selected rule by now)
* setRule(A') -> rule A' is selected, A selected event fired
* etc.

I have workarounded this problem by ignoring the unfortunate event fired by setModel().

Modified file: https://hg.netbeans.org/web-main/rev/faee90cf8409
Comment 4 Quality Engineering 2015-07-29 01:28:34 UTC
Integrated into 'main-silver', will be available in build *201507290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/faee90cf8409
User: Jan Stola <jstola@netbeans.org>
Log: #246134: CSS Styles window repopulating in endless loop
Comment 5 Quality Engineering 2015-07-30 01:23:47 UTC
Integrated into 'main-silver', will be available in build *201507300002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/376bde7a7672
User: Jan Stola <jstola@netbeans.org>
Log: Improving the fix of issue #246134.