[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

eric at webkit.org eric at webkit.org
Wed Feb 10 22:12:26 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 0b7a07da5a5d1714b4a901ef353545127565f042
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 4 08:41:50 2010 +0000

    2010-02-04  Jeremy Moskovich  <jeremy at chromium.org>
    
            Reviewed by David Levin.
    
            [Chromium] WebKit side of "Writing direction" context menu on OS X.
            https://bugs.webkit.org/show_bug.cgi?id=34524
    
            * public/WebContextMenuData.h:
            (WebKit::WebContextMenuData::):
            * src/ContextMenuClientImpl.cpp:
            (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54331 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 956d6bd..9bfa479 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-04  Jeremy Moskovich  <jeremy at chromium.org>
+
+        Reviewed by David Levin.
+
+        [Chromium] WebKit side of "Writing direction" context menu on OS X.
+        https://bugs.webkit.org/show_bug.cgi?id=34524
+
+        * public/WebContextMenuData.h:
+        (WebKit::WebContextMenuData::):
+        * src/ContextMenuClientImpl.cpp:
+        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+
 2010-02-03  Drew Wilson  <atwilson at chromium.org>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebKit/chromium/public/WebContextMenuData.h b/WebKit/chromium/public/WebContextMenuData.h
index b4acb1c..049da9c 100644
--- a/WebKit/chromium/public/WebContextMenuData.h
+++ b/WebKit/chromium/public/WebContextMenuData.h
@@ -97,6 +97,18 @@ struct WebContextMenuData {
     // Whether context is editable.
     bool isEditable;
 
+    enum CheckableMenuItemFlags {
+        CheckableMenuItemDisabled = 0x0,
+        CheckableMenuItemEnabled = 0x1,
+        CheckableMenuItemChecked = 0x2,
+    };
+
+    // Writing direction menu items.
+    // Currently only used on OS X.
+    int writingDirectionDefault;
+    int writingDirectionLeftToRight;
+    int writingDirectionRightToLeft;
+
     enum EditFlags {
         CanDoNone = 0x0,
         CanUndo = 0x1,
diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp
index eb6a6c0..8472082 100644
--- a/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -31,6 +31,8 @@
 #include "config.h"
 #include "ContextMenuClientImpl.h"
 
+#include "CSSPropertyNames.h"
+#include "CSSStyleDeclaration.h"
 #include "ContextMenu.h"
 #include "Document.h"
 #include "DocumentLoader.h"
@@ -201,6 +203,22 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems(
         }
     }
 
+#if OS(DARWIN)
+    // Writing direction context menu.
+    data.writingDirectionDefault = WebContextMenuData::CheckableMenuItemDisabled;
+    data.writingDirectionLeftToRight = WebContextMenuData::CheckableMenuItemEnabled;
+    data.writingDirectionRightToLeft = WebContextMenuData::CheckableMenuItemEnabled;
+
+    ExceptionCode ec = 0;
+    RefPtr<CSSStyleDeclaration> style = selectedFrame->document()->createCSSStyleDeclaration();
+    style->setProperty(CSSPropertyDirection, "ltr", false, ec);
+    if (selectedFrame->editor()->selectionHasStyle(style.get()) != FalseTriState)
+        data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuItemChecked;
+    style->setProperty(CSSPropertyDirection, "rtl", false, ec);
+    if (selectedFrame->editor()->selectionHasStyle(style.get()) != FalseTriState)
+        data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuItemChecked;
+#endif // OS(DARWIN)
+
     // Now retrieve the security info.
     DocumentLoader* dl = selectedFrame->loader()->documentLoader();
     WebDataSource* ds = WebDataSourceImpl::fromDocumentLoader(dl);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list