Title: [89659] trunk
Revision
89659
Author
ca...@chromium.org
Date
2011-06-24 01:43:28 -0700 (Fri, 24 Jun 2011)

Log Message

2011-06-24  Andrey Kosyakov  <ca...@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: extension panel iframes do not span entire panel client area
        https://bugs.webkit.org/show_bug.cgi?id=63165

        * inspector/front-end/ExtensionServer.js:
        (WebInspector.ExtensionServer.prototype._onCreatePanel):
        (WebInspector.ExtensionServer.prototype.createClientIframe):
        * inspector/front-end/inspector.css:
        (iframe.extension):
        (iframe.panel.extension):

2011-06-24  Andrey Kosyakov  <ca...@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: extension panel iframes do not span entire panel client area
        https://bugs.webkit.org/show_bug.cgi?id=63165

        * http/tests/inspector/extensions-test.js:
        (initialize_ExtensionsTest.InspectorTest.showPanel):
        ():
        * http/tests/inspector/inspector-test.js:
        ():
        * http/tests/inspector/resources/extension-main.html:
        * http/tests/inspector/resources/extension-main.js:
        (dumpObject):
        (dumpArray):
        (evaluateOnFrontend.callbackWrapper):
        (evaluateOnFrontend):
        ():
        * http/tests/inspector/resources/extension-panel.html:
        * inspector/extensions/extensions-events.html:
        * inspector/extensions/extensions-expected.txt:
        * inspector/extensions/extensions.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89658 => 89659)


--- trunk/LayoutTests/ChangeLog	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/ChangeLog	2011-06-24 08:43:28 UTC (rev 89659)
@@ -2,6 +2,30 @@
 
         Reviewed by Yury Semikhatsky.
 
+        Web Inspector: extension panel iframes do not span entire panel client area
+        https://bugs.webkit.org/show_bug.cgi?id=63165
+
+        * http/tests/inspector/extensions-test.js:
+        (initialize_ExtensionsTest.InspectorTest.showPanel):
+        ():
+        * http/tests/inspector/inspector-test.js:
+        ():
+        * http/tests/inspector/resources/extension-main.html:
+        * http/tests/inspector/resources/extension-main.js:
+        (dumpObject):
+        (dumpArray):
+        (evaluateOnFrontend.callbackWrapper):
+        (evaluateOnFrontend):
+        ():
+        * http/tests/inspector/resources/extension-panel.html:
+        * inspector/extensions/extensions-events.html:
+        * inspector/extensions/extensions-expected.txt:
+        * inspector/extensions/extensions.html:
+
+2011-06-24  Andrey Kosyakov  <ca...@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
         Web Inspector: [refactoring] extension tests: replace dispatchOnFrontend with a more generic evaluateOnFrontend()
         https://bugs.webkit.org/show_bug.cgi?id=63160
 

Modified: trunk/LayoutTests/http/tests/inspector/extensions-test.js (89658 => 89659)


--- trunk/LayoutTests/http/tests/inspector/extensions-test.js	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/http/tests/inspector/extensions-test.js	2011-06-24 08:43:28 UTC (rev 89659)
@@ -33,6 +33,13 @@
 
 window.addEventListener("message", InspectorTest.safeWrap(onMessage), false);
 
+InspectorTest.showPanel = function(panelId)
+{
+    if (panelId === "extension")
+        panelId = WebInspector.panelOrder[WebInspector.panelOrder.length - 1].name;
+    WebInspector.showPanel(panelId);
+}
+
 InspectorTest.runExtensionTests = function()
 {
     RuntimeAgent.evaluate("location.href", "console", false, function(error, result) {
@@ -49,6 +56,11 @@
 
 }
 
+function extension_showPanel(panelId, callback)
+{
+    evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) + "')); reply();", callback);
+}
+
 var test = function()
 {
     InspectorTest.runExtensionTests();

Modified: trunk/LayoutTests/http/tests/inspector/inspector-test.js (89658 => 89659)


--- trunk/LayoutTests/http/tests/inspector/inspector-test.js	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/http/tests/inspector/inspector-test.js	2011-06-24 08:43:28 UTC (rev 89659)
@@ -402,7 +402,7 @@
             }
         }
 
-        WebInspector.showPanel("console");
+        WebInspector.showPanel("audits");
         try {
             testFunction();
         } catch (e) {

Modified: trunk/LayoutTests/http/tests/inspector/resources/extension-main.html (89658 => 89659)


--- trunk/LayoutTests/http/tests/inspector/resources/extension-main.html	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/http/tests/inspector/resources/extension-main.html	2011-06-24 08:43:28 UTC (rev 89659)
@@ -1,61 +1,9 @@
 <html>
 <head>
+<script src=""
 <script type="text/_javascript_">
-
-function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix)
-{
-    prefix = prefix || "";
-    firstLinePrefix = firstLinePrefix || prefix;
-    output(firstLinePrefix + "{");
-    for (var prop in object) {
-        var prefixWithName = prefix + "    " + prop + " : ";
-        var propValue = object[prop];
-        if (nondeterministicProps && prop in nondeterministicProps)
-            output(prefixWithName + "<" + typeof propValue + ">");
-        else if (propValue === null)
-            output(prefixWithName + "null");
-        else if (typeof propValue === "object")
-            dumpObject(propValue, nondeterministicProps, prefix + "    ", prefixWithName);
-        else if (typeof propValue === "string")
-            output(prefixWithName + "\"" + propValue + "\"");
-        else if (typeof propValue === "function")
-            output(prefixWithName + "<function>");
-        else
-            output(prefixWithName + propValue);
-    }
-    output(prefix + "}");
-}
-
-function dumpArray(result)
-{
-    if (result instanceof Array) {
-        for (var i = 0; i < result.length; ++i)
-            output(result[i]);
-    } else
-        output(result);
-}
-
-function evaluateOnFrontend(_expression_, callback)
-{
-    function callbackWrapper(event)
-    {
-        channel.port1.removeEventListener("message", callbackWrapper, false);
-        callback(event.data.response);
-    }
-    var channel = new MessageChannel();
-    channel.port1.start();
-    if (callback)
-        channel.port1.addEventListener("message", callbackWrapper, false);
-    top.postMessage({ _expression_: _expression_ }, [ channel.port2 ], "*");
-}
-
-function output(message)
-{
-    evaluateOnFrontend("InspectorTest.addResult(unescape('" + escape(message) + "'));");
-}
-
 output("Started extension.");
+fetchTests();
 </script>
-<script src=""
 </head>
 </html>

Modified: trunk/LayoutTests/http/tests/inspector/resources/extension-main.js (89658 => 89659)


--- trunk/LayoutTests/http/tests/inspector/resources/extension-main.js	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/http/tests/inspector/resources/extension-main.js	2011-06-24 08:43:28 UTC (rev 89659)
@@ -1,3 +1,55 @@
+function dumpObject(object, nondeterministicProps, prefix, firstLinePrefix)
+{
+    prefix = prefix || "";
+    firstLinePrefix = firstLinePrefix || prefix;
+    output(firstLinePrefix + "{");
+    for (var prop in object) {
+        var prefixWithName = prefix + "    " + prop + " : ";
+        var propValue = object[prop];
+        if (nondeterministicProps && prop in nondeterministicProps)
+            output(prefixWithName + "<" + typeof propValue + ">");
+        else if (propValue === null)
+            output(prefixWithName + "null");
+        else if (typeof propValue === "object")
+            dumpObject(propValue, nondeterministicProps, prefix + "    ", prefixWithName);
+        else if (typeof propValue === "string")
+            output(prefixWithName + "\"" + propValue + "\"");
+        else if (typeof propValue === "function")
+            output(prefixWithName + "<function>");
+        else
+            output(prefixWithName + propValue);
+    }
+    output(prefix + "}");
+}
+
+function dumpArray(result)
+{
+    if (result instanceof Array) {
+        for (var i = 0; i < result.length; ++i)
+            output(result[i]);
+    } else
+        output(result);
+}
+
+function evaluateOnFrontend(_expression_, callback)
+{
+    function callbackWrapper(event)
+    {
+        channel.port1.removeEventListener("message", callbackWrapper, false);
+        callback(event.data.response);
+    }
+    var channel = new MessageChannel();
+    channel.port1.start();
+    if (callback)
+        channel.port1.addEventListener("message", callbackWrapper, false);
+    top.postMessage({ _expression_: _expression_ }, [ channel.port2 ], "*");
+}
+
+function output(message)
+{
+    evaluateOnFrontend("InspectorTest.addResult(unescape('" + escape(message) + "'));");
+}
+
 function onError(event)
 {
     window.removeEventListener("error", onError);
@@ -63,5 +115,3 @@
     var args = Array.prototype.slice.call(arguments, 2);
     return function() { return func.apply(thisObject, args.concat(Array.prototype.slice.call(arguments, 0))); };
 }
-
-fetchTests();

Modified: trunk/LayoutTests/http/tests/inspector/resources/extension-panel.html (89658 => 89659)


--- trunk/LayoutTests/http/tests/inspector/resources/extension-panel.html	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/http/tests/inspector/resources/extension-panel.html	2011-06-24 08:43:28 UTC (rev 89659)
@@ -1,2 +1,15 @@
 <html>
+<head>
+<script src=""
+<script type="text/_javascript_">
+function onLoad()
+{
+    var width = window.innerWidth;
+    var height = window.innerHeight;
+    evaluateOnFrontend("if (InspectorTest.panelCallback) InspectorTest.panelCallback(" + width + "," + height +");");
+}
+</script>
+</head>
+<body _onload_="onLoad()">
+</body>
 </html>

Modified: trunk/LayoutTests/inspector/extensions/extensions-events.html (89658 => 89659)


--- trunk/LayoutTests/inspector/extensions/extensions-events.html	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/inspector/extensions/extensions-events.html	2011-06-24 08:43:28 UTC (rev 89659)
@@ -4,21 +4,6 @@
 <script src=""
 <script type="text/_javascript_">
 
-function initialize_ExtensionEventTests()
-{
-    InspectorTest.showPanel = function(panelId)
-    {
-        if (panelId === "extension")
-            panelId = WebInspector.panelOrder[WebInspector.panelOrder.length - 1].name;
-        WebInspector.showPanel(panelId);
-    }
-}
-
-function extension_showPanel(panelId, callback)
-{
-    evaluateOnFrontend("InspectorTest.showPanel(unescape('" + escape(panelId) + "')); reply();", callback);
-}
-
 function extension_testOnSelectionChanged(nextTest)
 {
     function onSelectionChanged()

Modified: trunk/LayoutTests/inspector/extensions/extensions-expected.txt (89658 => 89659)


--- trunk/LayoutTests/inspector/extensions/extensions-expected.txt	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/inspector/extensions/extensions-expected.txt	2011-06-24 08:43:28 UTC (rev 89659)
@@ -3,7 +3,6 @@
 Started extension.
 Running tests...
 RUNNING TEST: extension_testCreatePanel
-done createPanel
 Panel created
 {
     onShown : {
@@ -19,6 +18,7 @@
         removeListener : <function>
     }
 }
+Extension panel size correct
 RUNNING TEST: extension_testSidebarPage
 Sidebar created
 {

Modified: trunk/LayoutTests/inspector/extensions/extensions.html (89658 => 89659)


--- trunk/LayoutTests/inspector/extensions/extensions.html	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/LayoutTests/inspector/extensions/extensions.html	2011-06-24 08:43:28 UTC (rev 89659)
@@ -16,17 +16,46 @@
             callback();
         });
     }
+
+    InspectorTest.panelCallback = function(width, height)
+    {
+        InspectorTest.checkPanelSize(width, height);
+        var callback = InspectorTest._pendingPanelSizeTestCallback;
+        if (callback) {
+            delete InspectorTest._pendingPanelSizeTestCallback;
+            callback();
+        }
+    }
+
+    InspectorTest.waitForPanel = function(callback)
+    {
+         InspectorTest._pendingPanelSizeTestCallback = callback;
+    }
+
+    InspectorTest.checkPanelSize = function(width, height)
+    {
+        var extensionPanel = WebInspector.panelOrder[WebInspector.panelOrder.length - 1];
+        var boundingRect = extensionPanel.element.parentElement.getBoundingClientRect();
+        InspectorTest.assertEquals(boundingRect.width, width, "panel width mismatch");
+        InspectorTest.assertEquals(boundingRect.height, height, "panel height mismatch");
+        InspectorTest.addResult("Extension panel size correct");
+    }
 }
 
 function extension_testCreatePanel(nextTest)
 {
+    var callbackCount = 0;
+
     function onPanelCreated(panel)
     {
         output("Panel created");
         dumpObject(panel);
+        // This will force extension iframe to be really loaded and will cause waitForPanel() callback below.
+        extension_showPanel("extension");
     }
-    webInspector.panels.create("Test Panel", "extension-panel.png", "extension-panel.html", callbackAndNextTest(onPanelCreated, nextTest));
-    output("done createPanel");
+    // The panel code is expected to report its size via InspectorTest.panelCallback()
+    evaluateOnFrontend("InspectorTest.waitForPanel(reply);", nextTest);
+    webInspector.panels.create("Test Panel", "extension-panel.png", "extension-panel.html", onPanelCreated);
 }
 
 function extension_testSidebarPage(nextTest)

Modified: trunk/Source/WebCore/ChangeLog (89658 => 89659)


--- trunk/Source/WebCore/ChangeLog	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/Source/WebCore/ChangeLog	2011-06-24 08:43:28 UTC (rev 89659)
@@ -1,3 +1,17 @@
+2011-06-24  Andrey Kosyakov  <ca...@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: extension panel iframes do not span entire panel client area
+        https://bugs.webkit.org/show_bug.cgi?id=63165
+
+        * inspector/front-end/ExtensionServer.js:
+        (WebInspector.ExtensionServer.prototype._onCreatePanel):
+        (WebInspector.ExtensionServer.prototype.createClientIframe):
+        * inspector/front-end/inspector.css:
+        (iframe.extension):
+        (iframe.panel.extension):
+
 2011-06-24  David Grogan  <dgro...@chromium.org>
 
         Reviewed by Pavel Feldman.

Modified: trunk/Source/WebCore/inspector/front-end/ExtensionServer.js (89658 => 89659)


--- trunk/Source/WebCore/inspector/front-end/ExtensionServer.js	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/Source/WebCore/inspector/front-end/ExtensionServer.js	2011-06-24 08:43:28 UTC (rev 89659)
@@ -209,7 +209,7 @@
         WebInspector.addPanel(panel);
 
         var iframe = this.createClientIframe(panel.element, message.url);
-        iframe.style.height = "100%";
+        iframe.addStyleClass("panel");
         return this._status.OK();
     },
 
@@ -233,7 +233,7 @@
     {
         var iframe = document.createElement("iframe");
         iframe.src = ""
-        iframe.style.width = "100%";
+        iframe.addStyleClass("extension");
         parent.appendChild(iframe);
         return iframe;
     },

Modified: trunk/Source/WebCore/inspector/front-end/inspector.css (89658 => 89659)


--- trunk/Source/WebCore/inspector/front-end/inspector.css	2011-06-24 08:25:50 UTC (rev 89658)
+++ trunk/Source/WebCore/inspector/front-end/inspector.css	2011-06-24 08:43:28 UTC (rev 89659)
@@ -929,6 +929,15 @@
     display: block;
 }
 
+iframe.extension {
+    width: 100%;
+}
+
+iframe.panel.extension {
+    display: block;
+    height: 100%;
+}
+
 .webkit-line-gutter-backdrop {
     /* Keep this in sync with view-source.css (.webkit-line-gutter-backdrop) */
     width: 31px;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to