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 244080 - CSS reload doesn't work for style-sheets added dynamically
Summary: CSS reload doesn't work for style-sheets added dynamically
Status: RESOLVED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: Inspection (show other bugs)
Version: 8.0
Hardware: All All
: P4 normal (vote)
Assignee: Jan Stola
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-25 15:21 UTC by Jan Stola
Modified: 2015-03-16 02:11 UTC (History)
0 users

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 2014-04-25 15:21:08 UTC
If a style-sheet is added dynamically (using JavaScript) and this style-sheet is modified in the IDE then it is not reloaded in the browser.

Test case:
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <script>
            var addStyleSheet = function() {
                //<link rel="stylesheet" href="css/test.css">
                var element = document.createElement('link');
                element.setAttribute('rel', 'stylesheet');
                element.setAttribute('href', 'css/test.css');
                document.head.appendChild(element);
            };
            var removeStyleSheet = function() {
                var element = document.getElementsByTagName('link')[0];
                element.parentNode.removeChild(element);
            }
        </script>
    </head>
    <body>
        <div>Element affected by css/test.css</div>
        <button onclick="addStyleSheet();">Add stylesheet</button>
        <button onclick="removeStyleSheet();">Remove stylesheet</button>
    </body>
</html>

Note that this issue is not related to issue 243853. This test-case never worked in the past. CSSUpdater always performed one-time initialization of the map of known style-sheets.
Comment 1 Jan Stola 2015-03-15 12:20:35 UTC
Fixed/implemented by https://hg.netbeans.org/web-main/rev/6709ca858958
Comment 2 Quality Engineering 2015-03-16 02:11:17 UTC
Integrated into 'main-silver', will be available in build *201503160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6709ca858958
User: Jan Stola <jstola@netbeans.org>
Log: #244080: CSS reload doesn't work for style-sheets added dynamically