Changeset 74185 in webkit


Ignore:
Timestamp:
Dec 16, 2010 6:09:28 AM (13 years ago)
Author:
apavlov@chromium.org
Message:

2010-12-16 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: Up/Down/PageUp/PageDown on a CSS property numeric value commit the value editor
https://bugs.webkit.org/show_bug.cgi?id=51114

The r74038 regressed the behaviour. This patch additionally ensures that both Metrics and Styles panes
are updated once a stylesheet is reverted.

WebCore:

  • inspector/front-end/ElementsPanel.js: (WebInspector.ElementsPanel.prototype._stylesPaneEdited): (WebInspector.ElementsPanel.prototype._metricsPaneEdited): (WebInspector.ElementsPanel.prototype._styleSheetChanged):

LayoutTests:

  • inspector/styles-add-blank-property-expected.txt:
  • inspector/styles-add-blank-property.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74182 r74185  
     12010-12-16  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Up/Down/PageUp/PageDown on a CSS property numeric value commit the value editor
     6        https://bugs.webkit.org/show_bug.cgi?id=51114
     7
     8        * inspector/styles-add-blank-property-expected.txt:
     9        * inspector/styles-add-blank-property.html:
     10
    1112010-12-16  Yury Semikhatsky  <yurys@chromium.org>
    212
  • trunk/LayoutTests/inspector/styles-add-blank-property-expected.txt

    r70880 r74185  
    1414[expanded] element.style { ()
    1515font-size: 12px;
    16 text-decoration: none;
     16margin-left: 3px;
    1717
    1818======== Matched CSS Rules ========
  • trunk/LayoutTests/inspector/styles-add-blank-property.html

    r73913 r74185  
    2828}
    2929
     30function frontend_createKeyboardEvent(eventName, keyIdentifier)
     31{
     32    var evt = document.createEvent("KeyboardEvent");
     33    evt.initKeyboardEvent(eventName, true /* can bubble */, true /* can cancel */, null /* view */, keyIdentifier, "");
     34    return evt;
     35}
     36
    3037function frontend_dumpInspectedStyle(testController)
    3138{
     
    3643    section.expand();
    3744    var treeElement = section.addNewBlankProperty();
     45    var enterKeyDown = frontend_createKeyboardEvent("keydown", "Enter");
     46    var incrementKeyDown = frontend_createKeyboardEvent("keydown", "Up");
     47
     48    function removeEmpty()
     49    {
     50        window.getSelection().anchorNode.dispatchEvent(enterKeyDown);
     51        frontend_dumpResults(testController);
     52    }
     53
     54    function commit()
     55    {
     56        treeElement.valueElement.dispatchEvent(enterKeyDown);
     57        testController.runAfterPendingDispatches(removeEmpty.bind(this));
     58        frontend_dumpResults(testController);
     59    }
     60
     61    function incrementAgain()
     62    {
     63        treeElement.valueElement.dispatchEvent(incrementKeyDown);
     64        testController.runAfterPendingDispatches(commit.bind(this));
     65    }
     66
    3867    treeElement.startEditing();
    39 
    40     var evt = document.createEvent("KeyboardEvent");
    41     evt.initKeyboardEvent("keydown", true /* can bubble */, true /* can cancel */, null /* view */, "Enter", "");
    42     treeElement.nameElement.textContent = "text-decoration";
    43     treeElement.valueElement.textContent = "none";
    44     treeElement.nameElement.dispatchEvent(evt);
    45 
    46     testController.runAfterPendingDispatches(frontend_dumpResults.bind(this, testController));
     68    treeElement.nameElement.textContent = "margin-left";
     69    treeElement.nameElement.dispatchEvent(enterKeyDown);
     70    treeElement.valueElement.textContent = "1px";
     71    treeElement.valueElement.firstChild.select();
     72    treeElement.valueElement.dispatchEvent(incrementKeyDown);
     73    testController.runAfterPendingDispatches(incrementAgain.bind(this));
    4774}
    4875
  • trunk/WebCore/ChangeLog

    r74184 r74185  
     12010-12-16  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Up/Down/PageUp/PageDown on a CSS property numeric value commit the value editor
     6        https://bugs.webkit.org/show_bug.cgi?id=51114
     7
     8        The r74038 regressed the behaviour. This patch additionally ensures that both Metrics and Styles panes
     9        are updated once a stylesheet is reverted.
     10
     11        * inspector/front-end/ElementsPanel.js:
     12        (WebInspector.ElementsPanel.prototype._stylesPaneEdited):
     13        (WebInspector.ElementsPanel.prototype._metricsPaneEdited):
     14        (WebInspector.ElementsPanel.prototype._styleSheetChanged):
     15
    1162010-12-16  Yury Semikhatsky  <yurys@chromium.org>
    217
  • trunk/WebCore/inspector/front-end/ElementsPanel.js

    r74103 r74185  
    444444    },
    445445
    446     _metricsPaneEdited: function()
    447     {
     446    _stylesPaneEdited: function()
     447    {
     448        // Once styles are edited, the Metrics pane should be updated.
    448449        this.sidebarPanes.metrics.needsUpdate = true;
    449450        this.updateMetrics();
    450451    },
    451452
    452     _stylesPaneEdited: function()
    453     {
     453    _metricsPaneEdited: function()
     454    {
     455        // Once metrics are edited, the Styles pane should be updated.
    454456        this.sidebarPanes.styles.needsUpdate = true;
    455457        this.updateStyles(true);
     
    458460    _styleSheetChanged: function()
    459461    {
     462        this._metricsPaneEdited();
    460463        this._stylesPaneEdited();
    461464    },
Note: See TracChangeset for help on using the changeset viewer.