Reviewed by Tim Hatcher.
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2007 21:29:41 +0000 (21:29 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2007 21:29:41 +0000 (21:29 +0000)
        Fix for <rdar://problem/4727607> REGRESSION: KeyScript is deprecated, need a new solution for forcing Roman input for password fields on Leopard

        * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
        Use TSMSetDocumentProperty and TSMRemoveDocumentProperty on Leopard disable and enable non-ascii input sources.

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

WebCore/ChangeLog
WebCore/page/mac/FrameMac.mm

index d2320a1ea32a7814b89da8507cf81800b303c504..9a0b09af8c7979ca8a29a0a444edf4054b52b4e8 100644 (file)
@@ -1,3 +1,12 @@
+2007-05-03  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        Fix for <rdar://problem/4727607> REGRESSION: KeyScript is deprecated, need a new solution for forcing Roman input for password fields on Leopard
+
+        * page/mac/FrameMac.mm: (WebCore::Frame::setUseSecureKeyboardEntry):
+        Use TSMSetDocumentProperty and TSMRemoveDocumentProperty on Leopard disable and enable non-ascii input sources.
+
 2007-05-03  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Anders
index bf45f623038b5f706180f20891ffaa4290f21464..db60f32ecf70bc8ca3946f9fb3387d027cfef315 100644 (file)
@@ -512,14 +512,19 @@ void Frame::setUseSecureKeyboardEntry(bool enable)
         return;
     if (enable) {
         EnableSecureEventInput();
-        // FIXME: Since KeyScript is deprecated in Leopard, we need a new solution for this. <rdar://problem/4727607>
 #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
         KeyScript(enableRomanKeyboardsOnly);
+#else
+        CFArrayRef inputSources = TISCreateASCIICapableInputSourceList();
+        TSMSetDocumentProperty(TSMGetActiveDocument(), kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources);
+        CFRelease(inputSources);
 #endif
     } else {
         DisableSecureEventInput();
 #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
         KeyScript(smKeyEnableKybds);
+#else
+        TSMRemoveDocumentProperty(TSMGetActiveDocument(), kTSMDocumentEnabledInputSourcesPropertyTag);
 #endif
     }
 }