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 - HtmlNavigatorPanelUI.pageModelDocumentChanged() passes obsolete nodes to PageModel.setSelectedNodes()
Summary: HtmlNavigatorPanelUI.pageModelDocumentChanged() passes obsolete nodes to Page...
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Navigator (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Jan Becicka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-10 16:58 UTC by Jan Stola
Modified: 2012-11-15 02:42 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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