brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Live Preview - Element highlighting from CSS does not update when DOM changes #2104

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by jasonsanjose Wednesday Nov 21, 2012 at 21:33 GMT Originally opened as https://github.com/adobe/brackets/issues/2188


Given the following html and css

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <title>Rotating Cube</title>
    <link rel="stylesheet" href="styles.css"/>
    <script src="jquery-1.7.min.js"></script>
    <script>
        (function () {
            'use strict';
            function addDiv() {
                $("#container").append($('<div class="newdiv">new div</div>'));
            }
            window.setInterval(addDiv, 1000);
        }());
    </script>
</head>

<body>
    <div id="container"/>
</body>
</html>
.newdiv {
    background: rgba(255, 0, 0, .5);
}
  1. Open live preview
  2. Set cursor inside the .newdiv rule
  3. Observe highlighting in browser

Actual: Only divs existing at the time of the cursorActivity are highlighted. Expected: Highlighting should track DOM change events. Other examples including modifying selectors on elements and removing elements that matched the selector.

core-ai-bot commented 3 years ago

Comment by jasonsanjose Wednesday Nov 21, 2012 at 21:47 GMT


I saw this http://www.backalleycoder.com/2012/04/25/i-want-a-damnodeinserted/ a few weeks back about using CSS animation in place of deprecated (and slow) DOM mutation events. It might be a way to catch the insertion case at least.

core-ai-bot commented 3 years ago

Comment by njx Monday Nov 26, 2012 at 19:15 GMT


Reviewed. Marking move to backlog. For sprint 17, we'll slightly alleviate this by updating the highlighting when the Brackets window is reactivated.

core-ai-bot commented 3 years ago

Comment by njx Wednesday Mar 27, 2013 at 16:48 GMT


We're already mitigating this by updating the highlight on scroll/refresh of the browser as well as when Brackets is reactivated. Adding this to https://trello.com/c/vsSZQjj6 - current idea is to add a little Refresh button in the browser to refresh the highlighting manually.