Changeset 102581 in webkit


Ignore:
Timestamp:
Dec 12, 2011 7:24:36 AM (12 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: [Styles] Modified selector text needs sanitization
https://bugs.webkit.org/show_bug.cgi?id=74291

Reviewed by Yury Semikhatsky.

Source/WebCore:

  • inspector/front-end/StylesSidebarPane.js:

LayoutTests:

  • inspector/styles/commit-selector-expected.txt:
  • inspector/styles/commit-selector.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r102578 r102581  
     12011-12-12  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Styles] Modified selector text needs sanitization
     4        https://bugs.webkit.org/show_bug.cgi?id=74291
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/styles/commit-selector-expected.txt:
     9        * inspector/styles/commit-selector.html:
     10
    1112011-11-30  Alexander Pavlov  <apavlov@chromium.org>
    212
  • trunk/LayoutTests/inspector/styles/commit-selector-expected.txt

    r99713 r102581  
    1717
    1818
    19 === After selector modification ===
     19=== After non-affecting selector modification ===
     20[expanded]
     21element.style  { ()
     22color: red;
     23
     24======== Matched CSS Rules ========
     25[expanded]
     26hr, #inspected  { (commit-selector.html:4)
     27/-- overloaded --/ color: green;
     28
     29[expanded]
     30div  { (user agent stylesheet)
     31display: block;
     32
     33
     34=== After affecting selector modification ===
    2035[expanded]
    2136element.style  { ()
  • trunk/LayoutTests/inspector/styles/commit-selector.html

    r97606 r102581  
    2121        var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
    2222        section.startEditingSelector();
    23         section._selectorElement.textContent = "#inspectedChanged";
     23        section._selectorElement.textContent = "hr, #inspected ";
    2424        section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
    2525        InspectorTest.runAfterPendingDispatches(step2);
     
    2828    function step2()
    2929    {
    30         InspectorTest.addResult("=== After selector modification ===");
     30        InspectorTest.addResult("=== After non-affecting selector modification ===");
     31        InspectorTest.dumpSelectedElementStyles(true);
     32        var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
     33        section.startEditingSelector();
     34        section._selectorElement.textContent = "#inspectedChanged";
     35        section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
     36        InspectorTest.runAfterPendingDispatches(step3);
     37    }
     38
     39    function step3()
     40    {
     41        InspectorTest.addResult("=== After affecting selector modification ===");
    3142        InspectorTest.dumpSelectedElementStyles(true);
    3243        InspectorTest.completeTest();
  • trunk/Source/WebCore/ChangeLog

    r102580 r102581  
     12011-12-12  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Styles] Modified selector text needs sanitization
     4        https://bugs.webkit.org/show_bug.cgi?id=74291
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/front-end/StylesSidebarPane.js:
     9
    1102011-12-12  Renata Hodovan  <reni@webkit.org>
    211
  • trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js

    r101671 r102581  
    12081208    editingSelectorCommitted: function(element, newContent, oldContent, context, moveDirection)
    12091209    {
    1210         if (newContent === oldContent)
     1210        if (newContent)
     1211            newContent = newContent.trim();
     1212        if (newContent === oldContent) {
     1213            // Revert to a trimmed version of the selector if need be.
     1214            this._selectorElement.textContent = newContent;
    12111215            return this._moveEditorFromSelector(moveDirection);
     1216        }
    12121217
    12131218        function successCallback(newRule, doesAffectSelectedNode)
Note: See TracChangeset for help on using the changeset viewer.