2011-04-13 Jon Lee <jonlee@apple.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Apr 2011 05:40:09 +0000 (05:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Apr 2011 05:40:09 +0000 (05:40 +0000)
        Reviewed by Maciej Stachowiak.

        REGRESSION(r81880): Paste menu is disabled for many edit fields (yahoo and google search, yahoo mail msg, forms, etc)
        https://bugs.webkit.org/show_bug.cgi?id=58284
        <rdar://problem/9246149>

        * WebCore.exp.in: Exporting EditingBehavior.h for use in WebKit2
        * editing/EditingBehavior.h:
        (WebCore::EditingBehavior::shouldClearSelectionWhenLosingWebPageFocus): moving the platform-specific code out of an #ifdef and into this class for run-time instead of compile-time checking
2011-04-13  Jon Lee  <jonlee@apple.com>

        Reviewed by Maciej Stachowiak.

        REGRESSION(r81880): Paste menu is disabled for many edit fields (yahoo and google search, yahoo mail msg, forms, etc)
        https://bugs.webkit.org/show_bug.cgi?id=58284
        <rdar://problem/9246149>

        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::setFocused): Check for whether we are not supposed to be focused AND whether our platform behavior dictates to clear out the selection

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83814 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/editing/EditingBehavior.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index ae0608c..c923160 100644 (file)
@@ -1,3 +1,15 @@
+2011-04-13  Jon Lee  <jonlee@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        REGRESSION(r81880): Paste menu is disabled for many edit fields (yahoo and google search, yahoo mail msg, forms, etc)
+        https://bugs.webkit.org/show_bug.cgi?id=58284
+        <rdar://problem/9246149>
+
+        * WebCore.exp.in: Exporting EditingBehavior.h for use in WebKit2
+        * editing/EditingBehavior.h:
+        (WebCore::EditingBehavior::shouldClearSelectionWhenLosingWebPageFocus): moving the platform-specific code out of an #ifdef and into this class for run-time instead of compile-time checking
+
 2011-04-13  Yael Aharon  <yael.aharon@nokia.com>
 
         Reviewed by Eric Seidel.
index e559b3c..17d0863 100644 (file)
@@ -1219,6 +1219,7 @@ __ZNK7WebCore5Range9firstNodeEv
 __ZNK7WebCore5Range9textQuadsERN3WTF6VectorINS_9FloatQuadELm0EEEb
 __ZNK7WebCore6Chrome12createWindowEPNS_5FrameERKNS_16FrameLoadRequestERKNS_14WindowFeaturesERKNS_16NavigationActionE
 __ZNK7WebCore6Cursor14platformCursorEv
+__ZNK7WebCore6Editor8behaviorEv
 __ZNK7WebCore6Editor12selectedTextEv
 __ZNK7WebCore6Editor13canEditRichlyEv
 __ZNK7WebCore6Editor16compositionRangeEv
index a367c52..4ee85f3 100644 (file)
@@ -59,6 +59,10 @@ public:
 
     // On Mac, when processing a contextual click, the object being clicked upon should be selected.
     bool shouldSelectOnContextualMenuClick() const { return m_type == EditingMacBehavior; }
+    
+    // On Mac, when the web view loses focus, any active selection clears. On Windows, the selection
+    // should remain highlighted, just in an inactive state.
+    bool shouldClearSelectionWhenLosingWebPageFocus() const { return m_type == EditingMacBehavior; }
 
 private:
     EditingBehaviorType m_type;
index 322f6ca..9f520fd 100644 (file)
@@ -1,3 +1,14 @@
+2011-04-13  Jon Lee  <jonlee@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        REGRESSION(r81880): Paste menu is disabled for many edit fields (yahoo and google search, yahoo mail msg, forms, etc)
+        https://bugs.webkit.org/show_bug.cgi?id=58284
+        <rdar://problem/9246149>
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setFocused): Check for whether we are not supposed to be focused AND whether our platform behavior dictates to clear out the selection
+
 2011-04-13  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Sam Weinig.
index c723338..859246e 100644 (file)
@@ -79,6 +79,7 @@
 #include <WebCore/DocumentMarkerController.h>
 #include <WebCore/DragController.h>
 #include <WebCore/DragData.h>
+#include <WebCore/EditingBehavior.h>
 #include <WebCore/EventHandler.h>
 #include <WebCore/FocusController.h>
 #include <WebCore/FormState.h>
@@ -1145,8 +1146,9 @@ void WebPage::viewWillEndLiveResize()
 
 void WebPage::setFocused(bool isFocused)
 {
-    if (!isFocused)
+    if (!isFocused && m_page->focusController()->focusedOrMainFrame()->editor()->behavior().shouldClearSelectionWhenLosingWebPageFocus())
         m_page->focusController()->focusedOrMainFrame()->selection()->clear();
+
     m_page->focusController()->setFocused(isFocused);
 }