Bug 14685 - text-align affects <select> button but not its drop-down menu
Summary: text-align affects <select> button but not its drop-down menu
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2007-07-20 01:35 PDT by mitz
Modified: 2007-09-06 05:27 PDT (History)
2 users (show)

See Also:


Attachments
Test case (1.25 KB, text/html)
2007-07-20 01:35 PDT, mitz
no flags Details
Windows Safari rendering (20.58 KB, image/png)
2007-07-20 01:36 PDT, mitz
no flags Details
WinIE 7 rendering (6.82 KB, image/png)
2007-07-20 01:36 PDT, mitz
no flags Details
Use left alignment and natural writing direction in popup buttons and menus on Windows. (14.82 KB, patch)
2007-09-01 03:40 PDT, mitz
no flags Details | Formatted Diff | Diff
Use left alignment and natural writing direction in popup buttons and menus on Windows. (5.49 KB, patch)
2007-09-04 16:10 PDT, mitz
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2007-07-20 01:35:11 PDT
In Windows Safari, <select> buttons respect the text-align property but their drop-down menus do not. See the attached test case and screenshot.

In Mac Safari, the popup menus are always left-aligned (I think this is an AppKit constraint in Tiger), and the buttons are styled to match.

In WinIE7, text-align is ignored, but the direction property is used to decide between left- and right-alignment. The right-to-left button also has the drop-down arrow on the left.

Regardless of whether Windows Safari matches Mac Safari in this regard or not, the alignment and writing direction in the drop-down should match those of the button itself.
Comment 1 mitz 2007-07-20 01:35:33 PDT
Created attachment 15592 [details]
Test case
Comment 2 mitz 2007-07-20 01:36:06 PDT
Created attachment 15593 [details]
Windows Safari rendering
Comment 3 mitz 2007-07-20 01:36:41 PDT
Created attachment 15594 [details]
WinIE 7 rendering
Comment 4 mitz 2007-07-20 02:06:11 PDT
I guess this was fixed at some point and then re-introduced in <http://trac.webkit.org/projects/webkit/changeset/21900> when fixing bug 13775 on the Mac. That patch coupled forced left-alignment with natural writing direction, and since Windows does not opt in for the latter, it no longer got the former.

To match Mac Safari, Windows can simply return true from PopupMenu::itemWritingDirectionIsNatural(). If Windows Safari is to have left alignment but specified writing direction, then either there should be a way for PopupMenu to specify those two features independently of each other, or PopupMenu can be given control over styling of the button (i.e. define a static function in PopupMenu that receives a RenderStyle and the item text and mutates the style as it sees fit to do).
Comment 5 David Kilzer (:ddkilzer) 2007-07-20 04:37:16 PDT
<rdar://problem/5349755>
Comment 6 Dave Hyatt 2007-07-20 14:47:52 PDT
We should match Mac I think.
Comment 7 mitz 2007-09-01 03:40:14 PDT
Created attachment 16172 [details]
Use left alignment and natural writing direction in popup buttons and menus on Windows.

Matches Mac.
Comment 8 mitz 2007-09-01 04:32:33 PDT
I think this bug is a regression from the first Windows beta...
Comment 9 mitz 2007-09-04 16:10:08 PDT
Created attachment 16201 [details]
Use left alignment and natural writing direction in popup buttons and menus on Windows.

Matches the Mac behavior.
Comment 10 Adam Roben (:aroben) 2007-09-05 09:19:04 PDT
Comment on attachment 16201 [details]
Use left alignment and natural writing direction in popup buttons and menus on Windows.

r=me

We should check in your testcase as a manual test (unless we have one already).
Comment 11 Mark Rowe (bdash) 2007-09-06 05:27:36 PDT
Landed in r25386.