Title: [202369] trunk/Tools
Revision
202369
Author
[email protected]
Date
2016-06-22 23:44:02 -0700 (Wed, 22 Jun 2016)

Log Message

[Win] Use Windows api function to find top level parent.
https://bugs.webkit.org/show_bug.cgi?id=159021

Reviewed by Brent Fulgham.

Delete findTopLevelParent function, and use Win32 function GetAncestor instead.
 
* DumpRenderTree/win/UIDelegate.cpp:
(UIDelegate::runModal):
(findTopLevelParent): Deleted.
* MiniBrowser/win/PrintWebUIDelegate.cpp:
(PrintWebUIDelegate::runModal):
(findTopLevelParent): Deleted.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (202368 => 202369)


--- trunk/Tools/ChangeLog	2016-06-23 06:33:07 UTC (rev 202368)
+++ trunk/Tools/ChangeLog	2016-06-23 06:44:02 UTC (rev 202369)
@@ -1,5 +1,21 @@
 2016-06-22  Per Arne Vollan  <[email protected]>
 
+        [Win] Use Windows api function to find top level parent.
+        https://bugs.webkit.org/show_bug.cgi?id=159021
+
+        Reviewed by Brent Fulgham.
+
+        Delete findTopLevelParent function, and use Win32 function GetAncestor instead.
+ 
+        * DumpRenderTree/win/UIDelegate.cpp:
+        (UIDelegate::runModal):
+        (findTopLevelParent): Deleted.
+        * MiniBrowser/win/PrintWebUIDelegate.cpp:
+        (PrintWebUIDelegate::runModal):
+        (findTopLevelParent): Deleted.
+
+2016-06-22  Per Arne Vollan  <[email protected]>
+
         [Win] The test storage/indexeddb/modern/handle-user-delete.html is timing out.
         https://bugs.webkit.org/show_bug.cgi?id=158934
 

Modified: trunk/Tools/DumpRenderTree/win/UIDelegate.cpp (202368 => 202369)


--- trunk/Tools/DumpRenderTree/win/UIDelegate.cpp	2016-06-23 06:33:07 UTC (rev 202368)
+++ trunk/Tools/DumpRenderTree/win/UIDelegate.cpp	2016-06-23 06:44:02 UTC (rev 202369)
@@ -380,25 +380,12 @@
     return S_OK;
 }
 
-static HWND findTopLevelParent(HWND window)
-{
-    if (!window)
-        return nullptr;
-
-    HWND current = window;
-    for (HWND parent = GetParent(current); current; current = parent, parent = GetParent(parent)) {
-        if (!parent)
-            return current;
-    }
-    ASSERT_NOT_REACHED();
-    return nullptr;
-}
-
 HRESULT UIDelegate::runModal(_In_opt_ IWebView* webView)
 {
     COMPtr<IWebView> protector(webView);
 
-    auto topLevelParent = findTopLevelParent(::GetWindow(m_modalDialogParent, GW_OWNER));
+    auto modalDialogOwner = ::GetWindow(m_modalDialogParent, GW_OWNER);
+    auto topLevelParent = ::GetAncestor(modalDialogOwner, GA_ROOT);
 
     ::EnableWindow(topLevelParent, FALSE);
 

Modified: trunk/Tools/MiniBrowser/win/PrintWebUIDelegate.cpp (202368 => 202369)


--- trunk/Tools/MiniBrowser/win/PrintWebUIDelegate.cpp	2016-06-23 06:33:07 UTC (rev 202368)
+++ trunk/Tools/MiniBrowser/win/PrintWebUIDelegate.cpp	2016-06-23 06:44:02 UTC (rev 202369)
@@ -297,25 +297,12 @@
     return S_OK;
 }
 
-static HWND findTopLevelParent(HWND window)
-{
-    if (!window)
-        return nullptr;
-
-    HWND current = window;
-    for (HWND parent = GetParent(current); current; current = parent, parent = GetParent(parent)) {
-        if (!parent)
-            return current;
-    }
-    ASSERT_NOT_REACHED();
-    return nullptr;
-}
-
 HRESULT PrintWebUIDelegate::runModal(_In_opt_ IWebView* webView)
 {
     COMPtr<IWebView> protector(webView);
 
-    auto topLevelParent = findTopLevelParent(::GetWindow(m_modalDialogParent, GW_OWNER));
+    auto modalDialogOwner = ::GetWindow(m_modalDialogParent, GW_OWNER);
+    auto topLevelParent = ::GetAncestor(modalDialogOwner, GA_ROOT);
 
     ::EnableWindow(topLevelParent, FALSE);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to