REGRESSION: Links are clickable when a contentEditable is set to true.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Apr 2011 21:26:45 +0000 (21:26 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Apr 2011 21:26:45 +0000 (21:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=58473
<rdar://problem/9256793>

Reviewed by Dan Bernstein.

Added support for editable link behavior property.

* Shared/WebPreferencesStore.cpp:
* Shared/WebPreferencesStore.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetEditableLinkBehavior):
(WKPreferencesGetEditableLinkBehavior):
* UIProcess/API/C/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.cpp
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index f07fc9d..16e63aa 100644 (file)
@@ -1,3 +1,22 @@
+2011-04-13  Enrica Casucci  <enrica@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        REGRESSION: Links are clickable when a contentEditable is set to true.
+        https://bugs.webkit.org/show_bug.cgi?id=58473
+        <rdar://problem/9256793>
+        
+        Added support for editable link behavior property.
+
+        * Shared/WebPreferencesStore.cpp:
+        * Shared/WebPreferencesStore.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetEditableLinkBehavior):
+        (WKPreferencesGetEditableLinkBehavior):
+        * UIProcess/API/C/WKPreferencesPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2011-04-12  Alexey Proskuryakov  <ap@apple.com>
 
         Reviewed by Oliver Hunt.
index d012551..e0bbd4e 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "FontSmoothingLevel.h"
 #include "WebCoreArgumentCoders.h"
+#include <WebCore/Settings.h>
 
 namespace WebKit {
 
index 1cfedf8..8bef2b4 100644 (file)
@@ -87,6 +87,7 @@ namespace WebKit {
     macro(DefaultFontSize, defaultFontSize, UInt32, uint32_t, 16) \
     macro(DefaultFixedFontSize, defaultFixedFontSize, UInt32, uint32_t, 13) \
     macro(PDFDisplayMode, pdfDisplayMode, UInt32, uint32_t, 1) \
+    macro(EditableLinkBehavior, editableLinkBehavior, UInt32, uint32_t, WebCore::EditableLinkNeverLive) \
     \
 
 #if PLATFORM(WIN)
index c60cefa..2fbf866 100644 (file)
@@ -261,6 +261,16 @@ uint32_t WKPreferencesGetMinimumFontSize(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->minimumFontSize();
 }
 
+void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior behavior)
+{
+    toImpl(preferencesRef)->setEditableLinkBehavior(behavior);
+}
+
+WKEditableLinkBehavior WKPreferencesGetEditableLinkBehavior(WKPreferencesRef preferencesRef)
+{
+    return static_cast<WKEditableLinkBehavior>(toImpl(preferencesRef)->editableLinkBehavior());
+}
+
 void WKPreferencesSetDefaultTextEncodingName(WKPreferencesRef preferencesRef, WKStringRef name)
 {
     toImpl(preferencesRef)->setDefaultTextEncodingName(toWTFString(name));
index ddf1b9a..d67db14 100644 (file)
@@ -43,10 +43,23 @@ enum WKFontSmoothingLevel {
 };
 typedef enum WKFontSmoothingLevel WKFontSmoothingLevel;
 
+enum WKEditableLinkBehavior {
+    kWKEditableLinkBehaviorDefault,
+    kWKEditableLinkBehaviorAlwaysLive,
+    kWKEditableLinkBehaviorOnlyLiveWithShiftKey,
+    kWKEditableLinkBehaviorLiveWhenNotFocused,
+    kWKEditableLinkBehaviorNeverLive
+};
+typedef enum WKEditableLinkBehavior WKEditableLinkBehavior;
+
 // Defaults to kWKFontSmoothingLevelMedium.
 WK_EXPORT void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef, WKFontSmoothingLevel);
 WK_EXPORT WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef);
 
+// Defaults to EditableLinkNeverLive.
+WK_EXPORT void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior);
+WK_EXPORT WKEditableLinkBehavior WKPreferencesGetEditableLinkBehavior(WKPreferencesRef preferencesRef);   
+    
 // Defaults to false.
 WK_EXPORT void WKPreferencesSetAcceleratedDrawingEnabled(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetAcceleratedDrawingEnabled(WKPreferencesRef);
index 6cb1e3b..c723338 100644 (file)
@@ -1396,6 +1396,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings->setMinimumLogicalFontSize(store.getUInt32ValueForKey(WebPreferencesKey::minimumLogicalFontSizeKey()));
     settings->setDefaultFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFontSizeKey()));
     settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey()));
+    settings->setEditableLinkBehavior(static_cast<WebCore::EditableLinkBehavior>(store.getUInt32ValueForKey(WebPreferencesKey::editableLinkBehaviorKey())));
 
     settings->setAcceleratedCompositingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedCompositingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());
     settings->setAcceleratedDrawingEnabled(store.getBoolValueForKey(WebPreferencesKey::acceleratedDrawingEnabledKey()) && LayerTreeHost::supportsAcceleratedCompositing());