[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

apavlov at chromium.org apavlov at chromium.org
Fri Jan 21 14:45:35 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 784c2b7595e58c62b18baa2a0611b232dc52ab6e
Author: apavlov at chromium.org <apavlov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 29 11:53:48 2010 +0000

    2010-12-28  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: A disabled style property should get enabled when edited
            https://bugs.webkit.org/show_bug.cgi?id=51679
    
            * inspector/styles-disable-then-change-expected.txt: Added.
            * inspector/styles-disable-then-change.html: Added.
    2010-12-28  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: A disabled style property should get enabled when edited
            https://bugs.webkit.org/show_bug.cgi?id=51679
    
            Test: inspector/styles-disable-then-change.html
    
            * inspector/front-end/CSSStyleModel.js:
            (WebInspector.CSSProperty.prototype.setText):
            (WebInspector.CSSProperty.prototype.setText.callback):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74740 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 87c16b3..eabe11f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-28  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: A disabled style property should get enabled when edited
+        https://bugs.webkit.org/show_bug.cgi?id=51679
+
+        * inspector/styles-disable-then-change-expected.txt: Added.
+        * inspector/styles-disable-then-change.html: Added.
+
 2010-12-29  Helder Correia  <helder at sencha.com>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/inspector/styles-disable-then-change-expected.txt b/LayoutTests/inspector/styles-disable-then-change-expected.txt
new file mode 100755
index 0000000..4b4496d
--- /dev/null
+++ b/LayoutTests/inspector/styles-disable-then-change-expected.txt
@@ -0,0 +1,18 @@
+Tests that changing a disabled property enables it as well.
+
+Before disable
+[expanded] element.style { ()
+font-weight: bold;
+
+
+After disable
+[expanded] element.style { ()
+/-- overloaded --/ /-- disabled --/ font-weight: bold;
+
+
+After change
+[expanded] element.style { ()
+color: green;
+
+
+
diff --git a/LayoutTests/inspector/styles-disable-then-change.html b/LayoutTests/inspector/styles-disable-then-change.html
new file mode 100755
index 0000000..22fbcd5
--- /dev/null
+++ b/LayoutTests/inspector/styles-disable-then-change.html
@@ -0,0 +1,58 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="elements-tests2.js"></script>
+<script>
+
+function test()
+{
+    function selectContainerElementContinuation()
+    {
+        InspectorTest.selectElementAndRun("container", disableContainerStyle);
+    }
+
+    function disableContainerStyle()
+    {
+        var treeItem = InspectorTest.getElementStylePropertyTreeItem("font-weight");
+        InspectorTest.addResult("Before disable");
+        InspectorTest.addResults(InspectorTest.getSelectedElementStyles(true, true));
+
+        treeItem.toggleEnabled({ target: { checked: false } });
+        InspectorTest.runAfterPendingDispatches(changeContainerStyle);
+    }
+
+    function changeContainerStyle()
+    {
+        var treeItem = InspectorTest.getElementStylePropertyTreeItem("font-weight");
+        InspectorTest.addResult("After disable");
+        InspectorTest.addResults(InspectorTest.getSelectedElementStyles(true, true));
+
+        treeItem.applyStyleText("color: green", true);
+        InspectorTest.runAfterPendingDispatches(dumpResults);
+    }
+
+    function dumpResults()
+    {
+        InspectorTest.addResult("After change");
+        InspectorTest.addResults(InspectorTest.getSelectedElementStyles(true, true));
+        InspectorTest.completeTest();
+    }
+
+    InspectorTest.expandDOMSubtreeAndRun(null, selectContainerElementContinuation);
+}
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that changing a disabled property enables it as well.
+</p>
+
+<div id="container" style="font-weight:bold">
+</div>
+
+<div id="other">
+</div>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8e38c28..11a89e0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-28  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: A disabled style property should get enabled when edited
+        https://bugs.webkit.org/show_bug.cgi?id=51679
+
+        Test: inspector/styles-disable-then-change.html
+
+        * inspector/front-end/CSSStyleModel.js:
+        (WebInspector.CSSProperty.prototype.setText):
+        (WebInspector.CSSProperty.prototype.setText.callback):
+
 2010-12-29  Patrick Gansterer  <paroga at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/WebCore/inspector/front-end/CSSStyleModel.js b/WebCore/inspector/front-end/CSSStyleModel.js
index e8d75b7..4f20660 100644
--- a/WebCore/inspector/front-end/CSSStyleModel.js
+++ b/WebCore/inspector/front-end/CSSStyleModel.js
@@ -456,19 +456,31 @@ WebInspector.CSSProperty.prototype = {
     // Replaces "propertyName: propertyValue [!important];" in the stylesheet by an arbitrary propertyText.
     setText: function(propertyText, majorChange, userCallback)
     {
+        function enabledCallback(style)
+        {
+            if (style)
+                WebInspector.cssModel._styleSheetChanged(style.id.styleSheetId, majorChange);
+            if (userCallback)
+                userCallback(style);
+        }
+
         function callback(stylePayload)
         {
-            if (stylePayload)
+            if (stylePayload) {
                 this.text = propertyText;
-
-            if (!userCallback)
-                return;
-            if (!stylePayload)
-                userCallback(null);
-            else {
                 var style = WebInspector.CSSStyleDeclaration.parsePayload(stylePayload);
-                userCallback(style);
-                WebInspector.cssModel._styleSheetChanged(style.id.styleSheetId, majorChange);
+                var newProperty = style.allProperties[this.index];
+
+                if (newProperty && this.disabled && !propertyText.match(/^\s*$/)) {
+                    newProperty.setDisabled(false, enabledCallback);
+                    return;
+                } else
+                    WebInspector.cssModel._styleSheetChanged(style.id.styleSheetId, majorChange);
+                if (userCallback)
+                    userCallback(style);
+            } else {
+                if (userCallback)
+                    userCallback(null);
             }
         }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list