Title: [134327] trunk/Source
Revision
134327
Author
[email protected]
Date
2012-11-12 16:36:17 -0800 (Mon, 12 Nov 2012)

Log Message

Web Inspector: Fix docking behavior on Windows.
https://bugs.webkit.org/show_bug.cgi?id=101978

Reviewed by Brian Weinstein.

There are a number of problems with docking behaviour on Windows.
For starters, it does not ever constrain the inspector's size properly while docked.
It also does not properly set the whether or not the inspector can be docked/undocked.
This patch fixes both issues.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::frontendLoaded):
Switch order of calling bringToFront and setDockingUnavailable.
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::frontendLoaded): 
(WebInspectorFrontendClient::attachWindow):
Call restoreAttachedWindowHeight so that when first loading or reattaching the inspector,
we resize the inspector window properly.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134326 => 134327)


--- trunk/Source/WebCore/ChangeLog	2012-11-13 00:25:58 UTC (rev 134326)
+++ trunk/Source/WebCore/ChangeLog	2012-11-13 00:36:17 UTC (rev 134327)
@@ -1,3 +1,19 @@
+2012-11-12  Roger Fong  <[email protected]>
+
+        Web Inspector: Fix docking behaviour on Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=101978
+
+        Reviewed by Brian Weinstein.
+
+        There are a number of problems with docking behaviour on Windows.
+        For starters, it does not ever constrain the inspector's size properly while docked.
+        It also does not properly set the whether or not the inspector can be docked/undocked.
+        This patch fixes both issues.
+
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::frontendLoaded):
+        Switch order of calling bringToFront and setDockingUnavailable.
+
 2012-11-12  Adam Barth  <[email protected]>
 
         [V8] Update callers to use the aligned pointer API rather than the deprecated unaligned pointer API

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp (134326 => 134327)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp	2012-11-13 00:25:58 UTC (rev 134326)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp	2012-11-13 00:36:17 UTC (rev 134327)
@@ -140,8 +140,11 @@
 
 void InspectorFrontendClientLocal::frontendLoaded()
 {
+    // Call setDockingUnavailable before bringToFront. If we display the inspector window via bringToFront first it causes the call to canAttachWindow to return the wrong result on Windows.
+    // Calling bringToFront first causes the visibleHeight of the inspected page to always return 0 immediately after. 
+    // Thus if we call canAttachWindow first we can avoid this problem. This change does not cause any regressions on Mac.
+    setDockingUnavailable(!canAttachWindow());
     bringToFront();
-    setDockingUnavailable(!canAttachWindow());
     m_frontendLoaded = true;
     for (Vector<String>::iterator it = m_evaluateOnLoad.begin(); it != m_evaluateOnLoad.end(); ++it)
         evaluateOnLoad(*it);

Modified: trunk/Source/WebKit/win/ChangeLog (134326 => 134327)


--- trunk/Source/WebKit/win/ChangeLog	2012-11-13 00:25:58 UTC (rev 134326)
+++ trunk/Source/WebKit/win/ChangeLog	2012-11-13 00:36:17 UTC (rev 134327)
@@ -1,3 +1,21 @@
+2012-11-12  Roger Fong  <[email protected]>
+
+        Web Inspector: Fix docking behaviour on Windows.
+        https://bugs.webkit.org/show_bug.cgi?id=101978
+
+        Reviewed by Brian Weinstein.
+
+        There are a number of problems with docking behaviour on Windows.
+        For starters, it does not ever constrain the inspector's size properly while docked.
+        It also does not properly set the whether or not the inspector can be docked/undocked.
+        This patch fixes both issues.
+
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorFrontendClient::frontendLoaded): 
+        (WebInspectorFrontendClient::attachWindow):
+        Call restoreAttachedWindowHeight so that when first loading or reattaching the inspector,
+        we resize the inspector window properly.
+
 2012-11-05  Simon Fraser  <[email protected]>
 
         Fix layer borders to cleaning appear and disappear on switching

Modified: trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp (134326 => 134327)


--- trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp	2012-11-13 00:25:58 UTC (rev 134326)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebInspectorClient.cpp	2012-11-13 00:36:17 UTC (rev 134327)
@@ -254,6 +254,9 @@
 {
     InspectorFrontendClientLocal::frontendLoaded();
 
+    if (m_attached)
+        restoreAttachedWindowHeight();
+
     setAttachedWindow(m_attached);
 }
 
@@ -290,6 +293,13 @@
     m_inspectorClient->setInspectorStartsAttached(true);
 
     closeWindowWithoutNotifications();
+    // We need to set the attached window's height before we actually attach the window.
+    // Make sure that m_attached is true so that calling setAttachedWindowHeight from restoreAttachedWindowHeight doesn't return early. 
+    m_attached = true;
+    // Immediately after calling showWindowWithoutNotifications(), the parent frameview's visibleHeight incorrectly returns 0 always (Windows only).
+    // We are expecting this value to be just the height of the parent window when we call restoreAttachedWindowHeight, which it is before
+    // calling showWindowWithoutNotifications().
+    restoreAttachedWindowHeight();
     showWindowWithoutNotifications();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to