Closed Bug 1209411 Opened 9 years ago Closed 2 years ago

[windows] Dropdown arrow in vertical writing modes should point in the appropriate (sideways) direction

Categories

(Core :: Widget: Win32, defect, P5)

All
Windows
defect

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox44 --- wontfix
firefox103 --- fixed

People

(Reporter: jfkthame, Assigned: rkraesig, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, helpwanted, testcase, Whiteboard: [lang=c++])

Attachments

(4 files, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #1187605 +++

Bug 1187605 made the dropdown arrow point sideways by adding orientation-specific selectors in layout/style/forms.css. But on Windows, they remain stubbornly downward-pointing. I assume this means the Windows theme code is overriding the rendering of the arrows, so a similar fix will be needed there.
It looks like the dropdown arrow is drawn by widget code using Windows APIs (DrawThemeBackground). But that API doesn't support drawing it sideways for vertical elements. So to fix this, we'll need to avoid using the native theme API here in vertical mode, and draw the dropdown button ourselves instead.
Component: Layout: Form Controls → Widget: Win32
This works around the limitation of the Windows API here, and gives us the arrow pointing in the right direction. If we want to make it look more like the default horizontal-mode rendering, I suppose we could do that at the toolkit/themes/windows CSS level, but at least this fixes the basic functionality.
Attachment #8667174 - Flags: review?(jmathies)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Comment on attachment 8667174 [details] [diff] [review]
Can't use Windows theme APIs to draw the dropdown arrow in vertical writing-mode <select> elements

There's nothing in this patch.
Attachment #8667174 - Flags: review?(jmathies)
Oops, sorry about that! Try this one.
Attachment #8667204 - Flags: review?(jmathies)
Attachment #8667174 - Attachment is obsolete: true
Can you post a screen shot or test case I can load to see what this does? I'm wondering if we can still use the themed api and just rotate what it draws. I guess it depends on how the classic rendering looks.
With current Nightly, a testcase such as

  data:text/html,<div style="writing-mode:vertical-rl"><select><option>One<option>Two<option>Three

should work to show the behavior.

(The trouble with applying a rotate transform to the themed APIs rendering would be that there's a background gradient when the button is activated, and I don't think we'd want that gradient to rotate for vertical modes.)
Oh, I forgot to mention: for testing purposes, be sure to DISABLE e10s, due to bug 1170129.
Comment on attachment 8667204 [details] [diff] [review]
Can't use Windows theme APIs to draw the dropdown arrow in vertical writing-mode <select> elements

This isn't going to cut it, what you're doing is bring up the old classic themed widgets from windows 95. 

We need to figure out how to use the existing themed background and rotate it, or just stuck with the down arrow as is.
Attachment #8667204 - Flags: review?(jmathies) → review-
Attached image dropdown on win10
also note the design of this glyph changes between xp, win7, and win8+ so it can't be a single glyph.
Fair enough; but note the problem with rotating the DrawThemeBackground rendering, which will presumably result in a gradient that runs in the wrong direction (comment 6).

I'm not going to have time to look into this further for the time being.
Assignee: jfkthame → nobody
Status: ASSIGNED → NEW
(In reply to Jonathan Kew (:jfkthame) from comment #11)
> Fair enough; but note the problem with rotating the DrawThemeBackground
> rendering, which will presumably result in a gradient that runs in the wrong
> direction (comment 6).
> 
> I'm not going to have time to look into this further for the time being.

It might be possible to render the arrow alone without the background using different theme constants, we should look into that. Regardless I think UX would agree rendering the old classic themed button in modern versions of the os isn't an acceptable trade off.
Keywords: helpwanted
Whiteboard: [good first bug][lang=c++]
Priority: -- → P5
Whiteboard: [good first bug][lang=c++] → [good first bug][lang=c++][tpi:+]
hi, is this bug still exists? can i work on it as my first bug!
Keywords: good-first-bug
Whiteboard: [good first bug][lang=c++][tpi:+] → [lang=c++][tpi:+]

Other platforms are also affected since the switch to non-native theming in bug 1535761. We should detect the orientation and adjust the non-native dropdown arrow here: https://searchfox.org/mozilla-central/rev/d107bc8aeadcc816ba85cb21c1a6a1aac1d4ef9f/widget/nsNativeBasicTheme.cpp#713

Assigning myself as mentor.

Mentor: spohl.mozilla.bugs
Whiteboard: [lang=c++][tpi:+] → [lang=c++]
Assignee: nobody → rkraesig

Adjust the dropdown-arrow to take into account the orientation of the
dropdown itself, so as to point in the direction the dropdown should
emerge from.

The attached image shows the state of affairs with the above patch (incomplete due to lack of tests).

It's a bit awkward that the arrow now points in a different direction than the dropdown actually appears in. (Fixing that is bug 1170129.)

See Also: → 1170129

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: rkraesig → nobody
Assignee: nobody → rkraesig
Attachment #9264490 - Attachment description: WIP: Bug 1209411 - adjust dropdown-arrow orientation → Bug 1209411 - adjust dropdown-arrow orientation r?spohl,emilio
Status: NEW → ASSIGNED
Pushed by rkraesig@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/da7f58f21ff0
adjust dropdown-arrow orientation  r=emilio
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: