Changeset 128407 in webkit


Ignore:
Timestamp:
Sep 12, 2012 11:46:05 PM (12 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: [Styles] Styles not updated when there is a heavy stream of DOM updates
https://bugs.webkit.org/show_bug.cgi?id=96482

Reviewed by Vsevolod Vlasov.

Source/WebCore:

Update the Styles pane even if there is a pending rebuild update for the same current node.

  • inspector/front-end/StylesSidebarPane.js:

(WebInspector.StylesSidebarPane.prototype._rebuildUpdate):

LayoutTests:

  • inspector/styles/force-pseudo-state.html:
  • inspector/styles/force-pseudo-state-expected.txt:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128406 r128407  
     12012-09-12  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Styles] Styles not updated when there is a heavy stream of DOM updates
     4        https://bugs.webkit.org/show_bug.cgi?id=96482
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        * inspector/styles/force-pseudo-state.html:
     9        * inspector/styles/force-pseudo-state-expected.txt:
     10
    1112012-09-12  Stephanie Lewis  <slewis@apple.com>
    212
  • trunk/LayoutTests/inspector/styles/force-pseudo-state-expected.txt

    r123612 r128407  
    99======== Matched CSS Rules ========
    1010[expanded]
    11 div:active, a:active  { (force-pseudo-state.html:69)
     11div:active, a:active  { (force-pseudo-state.html:12)
    1212font-weight: bold;
    1313
    1414[expanded]
    15 div:hover, a:hover  { (force-pseudo-state.html:61)
     15div:hover, a:hover  { (force-pseudo-state.html:4)
    1616color: red;
    1717
     
    4040======== Matched CSS Rules ========
    4141[expanded]
    42 div:active, a:active  { (force-pseudo-state.html:69)
     42div:active, a:active  { (force-pseudo-state.html:12)
    4343font-weight: bold;
    4444
    4545[expanded]
    46 div:focus, a:focus  { (force-pseudo-state.html:65)
     46div:focus, a:focus  { (force-pseudo-state.html:8)
    4747border: 1px solid green;
    4848    border-top-color: green;
  • trunk/LayoutTests/inspector/styles/force-pseudo-state.html

    r125871 r128407  
    11<html>
    22<head>
     3<style>
     4div:hover, a:hover {
     5    color: red;
     6}
     7
     8div:focus, a:focus {
     9    border: 1px solid green;
     10}
     11
     12div:active, a:active {
     13    font-weight: bold;
     14}
     15
     16</style>
    317<script src="../../http/tests/inspector/inspector-test.js"></script>
    418<script src="../../http/tests/inspector/elements-test.js"></script>
     
    3246        InspectorTest.addResult("DIV with :hover and :active");
    3347        dumpData();
     48        InspectorTest.waitForStyles("div", hoverCallback, true);
    3449        WebInspector.panels.elements._setPseudoClassForNodeId(divNodeId, "hover", false);
    35         WebInspector.panels.elements._setPseudoClassForNodeId(divNodeId, "focus", true);
    36         InspectorTest.waitForStyles("div", divSelected2, true);
     50
     51        function hoverCallback()
     52        {
     53            InspectorTest.waitForStyles("div", divSelected2, true);
     54            WebInspector.panels.elements._setPseudoClassForNodeId(divNodeId, "focus", true);
     55        }
    3756    }
    3857
     
    4261        InspectorTest.addResult("DIV with :active and :focus");
    4362        dumpData();
     63        InspectorTest.waitForStyles("div", focusCallback, true);
    4464        WebInspector.panels.elements._setPseudoClassForNodeId(divNodeId, "focus", false);
    45         WebInspector.panels.elements._setPseudoClassForNodeId(divNodeId, "active", false);
    46         InspectorTest.waitForStyles("div", divSelected3, true);
     65
     66        function focusCallback()
     67        {
     68            InspectorTest.waitForStyles("div", divSelected3, true);
     69            WebInspector.panels.elements._setPseudoClassForNodeId(divNodeId, "active", false);
     70        }
    4771    }
    4872
     
    5377        dumpData();
    5478        InspectorTest.completeTest();
    55         return;
    5679    }
    5780}
    5881</script>
    59 
    60 <style>
    61 div:hover, a:hover {
    62     color: red;
    63 }
    64 
    65 div:focus, a:focus {
    66     border: 1px solid green;
    67 }
    68 
    69 div:active, a:active {
    70     font-weight: bold;
    71 }
    72 
    73 </style>
    7482</head>
    75 
    7683<body id="mainBody" class="main1 main2 mainpage" onload="runTest()" style="font-weight: normal; width: 85%; background-image: url(bar.png)">
    7784<p>
  • trunk/Source/WebCore/ChangeLog

    r128405 r128407  
     12012-09-12  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Styles] Styles not updated when there is a heavy stream of DOM updates
     4        https://bugs.webkit.org/show_bug.cgi?id=96482
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        Update the Styles pane even if there is a pending rebuild update for the same current node.
     9
     10        * inspector/front-end/StylesSidebarPane.js:
     11        (WebInspector.StylesSidebarPane.prototype._rebuildUpdate):
     12
    1132012-09-12  Chris Fleizach  <cfleizach@apple.com>
    214
  • trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js

    r128291 r128407  
    235235    },
    236236
    237     /**
    238      * @param {function()=} userCallback
    239      */
    240     _rebuildUpdate: function(userCallback)
     237    _rebuildUpdate: function()
    241238    {
    242239        if (this._rebuildUpdateInProgress) {
     
    245242        }
    246243
    247         var node = this._validateNode(userCallback);
     244        var node = this._validateNode();
    248245        if (!node)
    249246            return;
     
    257254            delete this._rebuildUpdateInProgress;
    258255
    259             if (this._lastNodeForInnerRebuild) {
     256            var lastNodeForRebuild = this._lastNodeForInnerRebuild;
     257            if (lastNodeForRebuild) {
    260258                delete this._lastNodeForInnerRebuild;
    261                 this._rebuildUpdate(userCallback);
    262                 return;
     259                if (lastNodeForRebuild !== this.node) {
     260                    this._rebuildUpdate();
     261                    return;
     262                }
    263263            }
    264264
     
    269269                this._innerRebuildUpdate(node, resultStyles);
    270270            }
    271             if (userCallback)
    272                 userCallback();
     271
     272            if (lastNodeForRebuild) {
     273                // lastNodeForRebuild is the same as this.node - another rebuild has been requested.
     274                this._rebuildUpdate();
     275                return;
     276            }
    273277        }
    274278
Note: See TracChangeset for help on using the changeset viewer.