Title: [121932] trunk/Source
Revision
121932
Author
ander...@apple.com
Date
2012-07-05 18:24:38 -0700 (Thu, 05 Jul 2012)

Log Message

Type-ahead doesn't work in options inside optgroups
https://bugs.webkit.org/show_bug.cgi?id=90647
<rdar://problem/5604894>

Reviewed by Dan Bernstein.

Set the title of the menu item to a string that doesn't contain any leading or trailing whitespace.

Source/WebCore:

* platform/mac/PopupMenuMac.mm:
(WebCore::PopupMenuMac::populate):

Source/WebKit2:

* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::populate):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121931 => 121932)


--- trunk/Source/WebCore/ChangeLog	2012-07-06 01:05:46 UTC (rev 121931)
+++ trunk/Source/WebCore/ChangeLog	2012-07-06 01:24:38 UTC (rev 121932)
@@ -1,3 +1,16 @@
+2012-07-05  Anders Carlsson  <ander...@apple.com>
+
+        Type-ahead doesn't work in options inside optgroups
+        https://bugs.webkit.org/show_bug.cgi?id=90647
+        <rdar://problem/5604894>
+
+        Reviewed by Dan Bernstein.
+
+        Set the title of the menu item to a string that doesn't contain any leading or trailing whitespace.
+
+        * platform/mac/PopupMenuMac.mm:
+        (WebCore::PopupMenuMac::populate):
+
 2012-07-05  Hayato Ito  <hay...@chromium.org>
 
         [Crash] Click an element which will be 'display: none' on focus.

Modified: trunk/Source/WebCore/platform/mac/PopupMenuMac.mm (121931 => 121932)


--- trunk/Source/WebCore/platform/mac/PopupMenuMac.mm	2012-07-06 01:05:46 UTC (rev 121931)
+++ trunk/Source/WebCore/platform/mac/PopupMenuMac.mm	2012-07-06 01:24:38 UTC (rev 121932)
@@ -119,6 +119,9 @@
             [m_popup.get() addItemWithTitle:@""];
             NSMenuItem *menuItem = [m_popup.get() lastItem];
             [menuItem setAttributedTitle:string];
+            // We set the title as well as the attributed title here. The attributed title will be displayed in the menu,
+            // but typeahead will use the non-attributed string that doesn't contain any leading or trailing whitespace.
+            [menuItem setTitle:[[string string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];
             [menuItem setEnabled:client()->itemIsEnabled(i)];
             [menuItem setToolTip:client()->itemToolTip(i)];
             [string release];

Modified: trunk/Source/WebKit2/ChangeLog (121931 => 121932)


--- trunk/Source/WebKit2/ChangeLog	2012-07-06 01:05:46 UTC (rev 121931)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-06 01:24:38 UTC (rev 121932)
@@ -1,3 +1,16 @@
+2012-07-05  Anders Carlsson  <ander...@apple.com>
+
+        Type-ahead doesn't work in options inside optgroups
+        https://bugs.webkit.org/show_bug.cgi?id=90647
+        <rdar://problem/5604894>
+
+        Reviewed by Dan Bernstein.
+
+        Set the title of the menu item to a string that doesn't contain any leading or trailing whitespace.
+
+        * UIProcess/mac/WebPopupMenuProxyMac.mm:
+        (WebKit::WebPopupMenuProxyMac::populate):
+
 2012-07-05  Christophe Dumez  <christophe.du...@intel.com>
 
         [WK2] Add C API for Battery Status API

Modified: trunk/Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm (121931 => 121932)


--- trunk/Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm	2012-07-06 01:05:46 UTC (rev 121931)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm	2012-07-06 01:24:38 UTC (rev 121932)
@@ -87,6 +87,9 @@
             RetainPtr<NSAttributedString> string(AdoptNS, [[NSAttributedString alloc] initWithString:nsStringFromWebCoreString(items[i].m_text) attributes:attributes.get()]);
 
             [menuItem setAttributedTitle:string.get()];
+            // We set the title as well as the attributed title here. The attributed title will be displayed in the menu,
+            // but typeahead will use the non-attributed string that doesn't contain any leading or trailing whitespace.
+            [menuItem setTitle:[[string.get() string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];
             [menuItem setEnabled:items[i].m_isEnabled];
             [menuItem setToolTip:nsStringFromWebCoreString(items[i].m_toolTip)];
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to