Reviewed by Hyatt.
WebCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10575
Enable secure input mode for new password fields
* WebCore.exp: Added wkSetSecureEventInput and wkSecureEventInput.
* platform/mac/WebCoreSystemInterface.h: ditto.
* platform/mac/WebCoreSystemInterface.mm: ditto.
* page/Frame.cpp: (WebCore::Frame::setIsActive): Enables and disables secure keyboard entry based on whether the frame becomes active.
* bridge/mac/FrameMac.h:
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::setSecureKeyboardEntry): Added. Calls wkSetSecureEventInput.
(WebCore::FrameMac::secureKeyboardEntry): Added. Calls wkSecureEventInput.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::dispatchFocusEvent): For password fields, enable secure keyboard entry.
(WebCore::HTMLInputElement::dispatchBlurEvent): For password fields, disable secure keyboard entry.
* page/Frame.h:
(WebCore::Frame::setSecureKeyboardEntry):
(WebCore::Frame::secureKeyboardEntry):
WebKit:
Reviewed by Hyatt.
WebKit part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10575
Enable secure input mode for new password fields
* WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface):
WebKitLibraries:
Reviewed by Hyatt.
Updated for http://bugzilla.opendarwin.org/show_bug.cgi?id=10575
Enable secure input mode for new password fields
* WebKitSystemInterface.h: Added WKSetSecureEventInput and WKSecureEventInput;
* libWebKitSystemInterface.a:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16136
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-08-30 Adele Peterson <adele@apple.com>
+
+ Reviewed by Hyatt.
+
+ WebCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10575
+ Enable secure input mode for new password fields
+
+ * WebCore.exp: Added wkSetSecureEventInput and wkSecureEventInput.
+ * platform/mac/WebCoreSystemInterface.h: ditto.
+ * platform/mac/WebCoreSystemInterface.mm: ditto.
+
+ * page/Frame.cpp: (WebCore::Frame::setIsActive): Enables and disables secure keyboard entry based on whether the frame becomes active.
+ * bridge/mac/FrameMac.h:
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::setSecureKeyboardEntry): Added. Calls wkSetSecureEventInput.
+ (WebCore::FrameMac::secureKeyboardEntry): Added. Calls wkSecureEventInput.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::dispatchFocusEvent): For password fields, enable secure keyboard entry.
+ (WebCore::HTMLInputElement::dispatchBlurEvent): For password fields, disable secure keyboard entry.
+ * page/Frame.h:
+ (WebCore::Frame::setSecureKeyboardEntry):
+ (WebCore::Frame::secureKeyboardEntry):
+
2006-08-30 Darin Adler <darin@apple.com>
Reviewed by Tim Hatcher.
_wkPathFromFont
_wkPopupMenu
_wkReleaseStyleGroup
+_wkSecureEventInput
_wkSetCGFontRenderingMode
_wkSetDragImage
_wkSetNSURLConnectionDefersCallbacks
_wkSetPatternPhaseInUserSpace
+_wkSetSecureEventInput
_wkSetUpFontCache
_wkSignalCFReadStreamEnd
_wkSignalCFReadStreamError
virtual void textDidChangeInTextArea(Element*);
virtual bool inputManagerHasMarkedText() const;
+
+ virtual void setSecureKeyboardEntry(bool);
+ virtual bool secureKeyboardEntry();
KJS::Bindings::RootObject* executionContextForDOM();
KJS::Bindings::RootObject* bindingRootObject();
#import "HTMLFormElement.h"
#import "HTMLFrameElement.h"
#import "HTMLGenericFormElement.h"
+#import "HTMLInputElement.h"
#import "HTMLNames.h"
#import "HTMLTableCellElement.h"
#import "WebCoreEditCommand.h"
#import "htmlediting.h"
#import "kjs_window.h"
#import "visible_units.h"
+#import "WebCoreSystemInterface.h"
#import <JavaScriptCore/NP_jsobject.h>
#import <JavaScriptCore/npruntime_impl.h>
return false;
}
+void FrameMac::setSecureKeyboardEntry(bool enable)
+{
+ wkSetSecureEventInput(enable);
+}
+
+bool FrameMac::secureKeyboardEntry()
+{
+ return wkSecureEventInput();
+}
+
static DeprecatedValueList<MarkedTextUnderline> convertAttributesToUnderlines(const Range *markedTextRange, NSArray *attributes, NSArray *ranges)
{
DeprecatedValueList<MarkedTextUnderline> result;
void HTMLInputElement::dispatchFocusEvent()
{
- if (isNonWidgetTextField())
+ if (isNonWidgetTextField()) {
setAutofilled(false);
+ if (inputType() == PASSWORD && document()->frame())
+ document()->frame()->setSecureKeyboardEntry(true);
+ }
HTMLGenericFormElement::dispatchFocusEvent();
}
void HTMLInputElement::dispatchBlurEvent()
{
- if (isNonWidgetTextField() && document()->frame())
+ if (isNonWidgetTextField() && document()->frame()) {
+ if (inputType() == PASSWORD)
+ document()->frame()->setSecureKeyboardEntry(false);
document()->frame()->textFieldDidEndEditing(static_cast<Element*>(this));
+ }
HTMLGenericFormElement::dispatchBlurEvent();
}
}
}
- // 4, Changing the tint of controls from clear to aqua/graphite and vice versa. We
+ // 4. Changing the tint of controls from clear to aqua/graphite and vice versa. We
// do a "fake" paint. When the theme gets a paint call, it can then do an invalidate. This is only
// done if the theme supports control tinting.
if (doc && d->m_view && theme()->supportsControlTints() && renderer()) {
context.setUpdatingControlTints(true);
paint(&context, visibleRect);
}
+
+ // 5. Enable or disable secure keyboard entry
+ if ((flag && !secureKeyboardEntry() && doc && doc->focusNode()->hasTagName(inputTag) &&
+ static_cast<HTMLInputElement*>(doc->focusNode())->inputType() == HTMLInputElement::PASSWORD) ||
+ (!flag && secureKeyboardEntry()))
+ setSecureKeyboardEntry(flag);
}
void Frame::setWindowHasFocus(bool flag)
virtual bool inputManagerHasMarkedText() const { return false; }
+ virtual void setSecureKeyboardEntry(bool) {};
+ virtual bool secureKeyboardEntry() { return false; }
+
/**
* Returns the most recent edit command applied.
*/
extern NSString* (*wkPathFromFont)(NSFont*);
extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
extern void (*wkReleaseStyleGroup)(void* group);
+extern BOOL (*wkSecureEventInput)(void);
extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
+extern void (*wkSetSecureEventInput)(BOOL);
extern void (*wkSetUpFontCache)(size_t);
extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
NSString* (*wkPathFromFont)(NSFont*);
void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
void (*wkReleaseStyleGroup)(void* group);
+BOOL (*wkSecureEventInput)(void);
void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
void (*wkSetDragImage)(NSImage*, NSPoint offset);
void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
+void (*wkSetSecureEventInput)(BOOL);
void (*wkSetUpFontCache)(size_t);
void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
void *context);
void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
id (*wkCreateNSURLConnectionDelegateProxy)(void);
+
+2006-08-30 Adele Peterson <adele@apple.com>
+
+ Reviewed by Hyatt.
+
+ WebKit part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10575
+ Enable secure input mode for new password fields
+
+ * WebCoreSupport/WebSystemInterface.m: (InitWebCoreSystemInterface):
+
2006-08-30 Brady Eidson <beidson@apple.com>
Reviewed by John
INIT(PathFromFont);
INIT(PopupMenu);
INIT(ReleaseStyleGroup);
+ INIT(SecureEventInput);
INIT(SetCGFontRenderingMode);
INIT(SetDragImage);
INIT(SetPatternPhaseInUserSpace);
+ INIT(SetSecureEventInput);
INIT(SetUpFontCache);
INIT(SignalCFReadStreamEnd);
INIT(SignalCFReadStreamHasBytes);
+2006-08-30 Adele Peterson <adele@apple.com>
+
+ Reviewed by Hyatt.
+
+ Updated for http://bugzilla.opendarwin.org/show_bug.cgi?id=10575
+ Enable secure input mode for new password fields
+
+ * WebKitSystemInterface.h: Added WKSetSecureEventInput and WKSecureEventInput;
+ * libWebKitSystemInterface.a:
+
2006-07-09 Anders Carlsson <acarlsson@apple.com>
Reviewed by Darin.
void WKDisableCGDeferredUpdates(void);
+void WKSetSecureEventInput(BOOL enable);
+BOOL WKSecureEventInput(void);
+
Class WKNSURLProtocolClassForReqest(NSURLRequest *request);
unsigned WKGetNSAutoreleasePoolCount(void);