[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
carlosgc at webkit.org
carlosgc at webkit.org
Sun Feb 20 23:32:39 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 2988e57391bfc8c1aa9acf51209a7d741865b40f
Author: carlosgc at webkit.org <carlosgc at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 21 17:21:51 2011 +0000
2011-01-21 Carlos Garcia Campos <cgarcia at igalia.com>
Reviewed by Martin Robinson.
[GTK] Show caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=52878
Test: manual-tests/password-caps-lock.html
* platform/gtk/KeyEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Implement
currentCapsLockState() using GDK API.
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::paintCapsLockIndicator): Paint an icon
in the password field when the caps lock modifier is locked.
* platform/gtk/RenderThemeGtk.h:
2011-01-21 Carlos Garcia Campos <cgarcia at igalia.com>
Reviewed by Martin Robinson.
[GTK] Show caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=52878
Test: manual-tests/password-caps-lock.html
* webkit/webkitwebview.cpp:
(webkit_web_view_key_release_event): Call
capsLockStateMayHaveChanged() when caps lock key is pressed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 4316806..25ea370 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-21 Carlos Garcia Campos <cgarcia at igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Show caps lock indicator in password fields
+ https://bugs.webkit.org/show_bug.cgi?id=52878
+
+ Test: manual-tests/password-caps-lock.html
+
+ * platform/gtk/KeyEventGtk.cpp:
+ (WebCore::PlatformKeyboardEvent::currentCapsLockState): Implement
+ currentCapsLockState() using GDK API.
+ * platform/gtk/RenderThemeGtk.cpp:
+ (WebCore::RenderThemeGtk::paintCapsLockIndicator): Paint an icon
+ in the password field when the caps lock modifier is locked.
+ * platform/gtk/RenderThemeGtk.h:
+
2011-01-21 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/Source/WebCore/platform/gtk/KeyEventGtk.cpp b/Source/WebCore/platform/gtk/KeyEventGtk.cpp
index 50dfa4c..5a034d6 100644
--- a/Source/WebCore/platform/gtk/KeyEventGtk.cpp
+++ b/Source/WebCore/platform/gtk/KeyEventGtk.cpp
@@ -583,8 +583,7 @@ void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCom
bool PlatformKeyboardEvent::currentCapsLockState()
{
- notImplemented();
- return false;
+ return gdk_keymap_get_caps_lock_state(gdk_keymap_get_default());
}
void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk.cpp b/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
index dce7763..cd9e247 100644
--- a/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/Source/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -309,6 +309,24 @@ bool RenderThemeGtk::paintSearchField(RenderObject* o, const PaintInfo& i, const
return paintTextField(o, i, rect);
}
+bool RenderThemeGtk::paintCapsLockIndicator(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
+{
+ // The other paint methods don't need to check whether painting is disabled because RenderTheme already checks it
+ // before calling them, but paintCapsLockIndicator() is called by RenderTextControlSingleLine which doesn't check it.
+ if (paintInfo.context->paintingDisabled())
+ return true;
+
+ GRefPtr<GdkPixbuf> icon = getStockIcon(GTK_TYPE_ENTRY, GTK_STOCK_CAPS_LOCK_WARNING,
+ gtkTextDirection(renderObject->style()->direction()),
+ gtkIconState(this, renderObject), GTK_ICON_SIZE_MENU);
+
+ // GTK+ locates the icon right aligned in the entry. The given rectangle is already
+ // centered vertically by RenderTextControlSingleLine.
+ IntPoint iconPosition(rect.x() + rect.width() - gdk_pixbuf_get_width(icon.get()), rect.y());
+ paintGdkPixbuf(paintInfo.context, icon.get(), iconPosition);
+ return true;
+}
+
void RenderThemeGtk::adjustSliderTrackStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
{
style->setBoxShadow(0);
diff --git a/Source/WebCore/platform/gtk/RenderThemeGtk.h b/Source/WebCore/platform/gtk/RenderThemeGtk.h
index bce89d9..a55d131 100644
--- a/Source/WebCore/platform/gtk/RenderThemeGtk.h
+++ b/Source/WebCore/platform/gtk/RenderThemeGtk.h
@@ -169,6 +169,8 @@ protected:
virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&);
#endif
+ virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&);
+
private:
void platformInit();
static void setTextInputBorders(RenderStyle*);
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index efba40d..912c948 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,16 @@
+2011-01-21 Carlos Garcia Campos <cgarcia at igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Show caps lock indicator in password fields
+ https://bugs.webkit.org/show_bug.cgi?id=52878
+
+ Test: manual-tests/password-caps-lock.html
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_key_release_event): Call
+ capsLockStateMayHaveChanged() when caps lock key is pressed.
+
2011-01-19 Joone Hur <joone.hur at collabora.co.uk>
Reviewed by Andreas Kling.
diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp
index e5d5b84..c855507 100644
--- a/Source/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp
@@ -790,6 +790,9 @@ static gboolean webkit_web_view_key_release_event(GtkWidget* widget, GdkEventKey
if (!frame->view())
return FALSE;
+ if (event->keyval == GDK_Caps_Lock)
+ frame->eventHandler()->capsLockStateMayHaveChanged();
+
PlatformKeyboardEvent keyboardEvent(event);
if (frame->eventHandler()->keyEvent(keyboardEvent))
return TRUE;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list