Closed Bug 1579824 Opened 5 years ago Closed 4 years ago

[Android] selected attribute on HTML <option> doesn't work when <select> size is >1 (listbox select)

Categories

(Core :: Layout, defect, P1)

ARM
Android
defect

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox-esr68 --- wontfix
firefox70 --- wontfix
firefox71 --- wontfix
firefox77 --- fixed

People

(Reporter: siwon_97, Assigned: emilio)

Details

(Whiteboard: [layout:triage-discuss] [geckoview-])

Attachments

(10 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0

Steps to reproduce:

Try the following HTML page on Fennec 68.1

<!DOCTYPE html>
<html>
<body>
<select size="3">
<option value="1">A</option>
<option value="2" selected>B</option>
<option value="3">C</option>
</select>
<select size="2">
<option value="4">D</option>
<option value="5" selected>E</option>
</select>
</body>
</html>

Actual results:

Nothing is selected. When I select something in the first menu, it is highlighted. If then I press somewhere else on the screen, the highlighting dissapear, making it impossible to know what is actually selected.

Expected results:

The B and E should be in evidence, as they are selected, as on Firefox's Windows version. When selecting other items on the drop out menus, it should leave the new selection selected.

Hello,

I have managed to reproduce your issue on the latest builds: 71.0a1 (2019-09-8), 70.0b5 and Release 68.1 with a Samsung Galaxy S8+ (Android 8.0). The issue does not occur on Android Chrome or Firefox Windows.

I will mark the issue as New.

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → Android
Hardware: Unspecified → ARM

(In reply to Laurentiu Apahidean from comment #1)

Hello,

I have managed to reproduce your issue on the latest builds: 71.0a1 (2019-09-8), 70.0b5 and Release 68.1 with a Samsung Galaxy S8+ (Android 8.0). The issue does not occur on Android Chrome or Firefox Windows.

I will mark the issue as New.

Laurentiu, does this reproduce even if on Fenix?

Flags: needinfo?(laurentiu.apahidean)

(In reply to Makoto Kato [:m_kato] from comment #2)

Laurentiu, does this reproduce even if on Fenix?

I have retested it on Firefox Preview 1.4.0 (Build #12481824) 9/5 using a Samsung Galaxy S8+ (Android 8.0.0) and the issue is reproducible.

Flags: needinfo?(laurentiu.apahidean)
Component: General → Locale switching and selection

I can reproduce the issue in Firefox Reality Using GeckoView 71.

Component: Locale switching and selection → General
Product: Firefox for Android → GeckoView
Version: Firefox 68 → Trunk

Sending to [layout:triage-discuss]. Is this a Gecko Layout bug or an Android Widget style issue?

Component: General → Layout
Product: GeckoView → Core
Whiteboard: [layout:triage-discuss]

Not sure where the bug is, but this is pretty basic functionality to be broken on Android.

Component: Layout → Layout: Form Controls
Priority: -- → P1
Summary: HTML <option> selected doesn't work when<select> size is >1 → [Android] selected attribute on HTML <option> doesn't work when <select> size is >1 (listbox select)

The behavior I see is different, but equally bad. Things improve if I tap on the control.

This is likely a bug in the Android form-control implementation, which belongs under Widget:Android I think.

snorp, I know you've done some work in that area - do you know who'd be best to poke about this these days?

Component: Layout: Form Controls → Widget: Android
Flags: needinfo?(snorp)

For the record, my Firefox Preview (on play store beta-channel) on Pixel3/AndroidQ matches dbaron's rendering in comment 8, with both testcases. (testcase 2 has a different border/background, but the highlighted entries are still entirely missing as shown in dbaron's screenshot.)

Attached image Testcase1_and_2.png

Here are the screens of Firefox preview 2.0.0 on my Fairphone2 with Android 7.1.2.
After testing testcase2, it seems that testcase1 is trying to put a white highlighting on a white background. Same behaviour on Fennec 68.1.1
This is quite different from comment 8's image.

This bug seems to have various effects depending mainly on which version of Android the user is using.
Before having a Fairphone 2 that use Android 7.1.2, I had an Acer using Android 6.X and I did not have the bug. By retrying it with Fennec 68.1.1 on another Android 6.0 device (Emporia S2), I also do not notice any bug (see attached picture).

(In reply to Daniel Holbert [:dholbert] from comment #9)

This is likely a bug in the Android form-control implementation, which belongs under Widget:Android I think.

snorp, I know you've done some work in that area - do you know who'd be best to poke about this these days?

Most of the people who worked on that were Fennec frontend folks. I think the GeckoView team would like the Layout team to own this going forward if that's possible. My guess is that we have a lot of cruft here from early mobile web days that could be removed?

Flags: needinfo?(snorp)

Adding [geckoview-] whiteboard tag because the GeckoView team is not responsible for this widget behavior.

Component: Widget: Android → Layout
Whiteboard: [layout:triage-discuss] → [layout:triage-discuss] [geckoview-]

(In reply to Daniel Holbert [:dholbert] from comment #11)

For the record, my Firefox Preview (on play store beta-channel) on Pixel3/AndroidQ matches dbaron's rendering in comment 8, with both testcases. (testcase 2 has a different border/background, but the highlighted entries are still entirely missing as shown in dbaron's screenshot.)

~good news: I retested this, on the same device with the same Android version (android Q aka 10) as I was using in comment 11, and I'm not seeing any entirely-unpainted entries now. Hooray! (Not sure if that's from a firefox change vs. an Android update. shrug)

The two testcases look exactly like the screenshot in comment 12 to me now (though it's worth noting that the dotted-border and yellow background around/behind "B" only show up when I literally tap that element to focus it, as noted in that screenshot's descriptive text).

So: this is still broken, but it's not broken as badly as I'd described in comment 11. Basically, you can't tell which option is selected, with a default-styled <select multi>, so this is still problematic.

Flags: needinfo?(emilio)

These are all the colors that the android theme supports. Some of them are defined via prefs, others via some somewhat dubious native code.

Attachment #9138622 - Attachment mime type: text/plain → text/html

This doesn't change behavior, just makes the color return what we set right now
via prefs in mobile/android/app/mobile.js.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

They're supposed to be the same, though right now they are black on white
because only highlight was overridden via prefs.

I'll fix the bugs I found yesterday in a separate bug.

Depends on D69939

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fdb5b47d9c64
Hardcode some system colors. r=snorp
https://hg.mozilla.org/integration/autoland/rev/687759fd8798
Stop overriding system colors via prefs. r=snorp
https://hg.mozilla.org/integration/autoland/rev/a45871505bd4
Make the cell-highlight colors the same as highlight. r=snorp
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/251da9f03797
Minor cleanup, and fixup field to be white again.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: