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 221879

Summary: HtmlNavigatorPanelUI.pageModelDocumentChanged() passes obsolete nodes to PageModel.setSelectedNodes()
Product: web Reporter: Jan Stola <jstola>
Component: HTML NavigatorAssignee: Jan Becicka <jbecicka>
Status: RESOLVED FIXED    
Severity: normal CC: mfukala, pjiricka
Priority: P3    
Version: 7.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Jan Stola 2012-11-10 16:58:54 UTC
This issue has been found during evaluation of performance problems in issue 221739.

Look at HtmlNavigatorPanelUI.pageModelDocumentChanged():

    private synchronized void pageModelDocumentChanged() {
        //try to find corresponding FileObject for the inspected document
        inspectedFileObject = getInspectedFile(this.pageModel);
        inspectedFileChanged();
        
        //refresh selection
        if (pageModel != null) {
            List nodes = translate(manager.getSelectedNodes());
            pageModel.setSelectedNodes(nodes);
        }
    }

This method is called when the user navigates to another URL in the inspected tab. The method invokes the update of the content of the navigator and then attempts to set selected nodes to the PageModel. Unfortunately, the update of the content is asynchronous, i.e., the update is not done when the 'refresh selection' part of the method is executed. Hence, the nodes from the old document are passed to the model. Please, fix that.
Comment 1 Jan Becicka 2012-11-14 12:20:07 UTC
changeset   : 239085:ca8697a5c4d8
author      : Jan Becicka <jbecicka@netbeans.org>
date        : Wed Nov 14 13:14:37 CET 2012
summary     : #221879:  HtmlNavigatorPanelUI.pageModelDocumentChanged() passes obsolete nodes to PageModel.setSelectedNodes()
Comment 2 Quality Engineering 2012-11-15 02:42:33 UTC
Integrated into 'main-golden', will be available in build *201211150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ca8697a5c4d8
User: Jan Becicka <jbecicka@netbeans.org>
Log: #221879:  HtmlNavigatorPanelUI.pageModelDocumentChanged() passes obsolete nodes to PageModel.setSelectedNodes()
Issue #221919 - CSS Styles is cleared after Refresh on Save if Inspect mode is turned on