VOOZH about

URL: https://bugzilla.mozilla.org/show_bug.cgi?id=1979755

⇱ 1979755 - <select> button is blank & sized-as-if-empty, with `content:none`


Closed Bug 1979755 Opened 10 months ago Closed 10 months ago

<select> button is blank & sized-as-if-empty, with `content:none`

<select> button is blank & sized-as-if-empty, with `content:none`
Core
Layout: Form Controls
unspecified
Unspecified
Unspecified
defect
Points:
---
RESOLVED FIXED
RESOLVED
FIXED
143 Branch
Iteration:
---
a11y-review
Accessibility Severity
Performance Impact
Size Estimate
Webcompat Priority
Webcompat Score
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- wontfix
firefox-esr140 --- wontfix
firefox141 --- wontfix
firefox142 --- wontfix
firefox143 --- fixed
Tracking Status
relnote-firefox
thunderbird_esr115
thunderbird_esr140
firefox-esr115
firefox-esr128
firefox-esr140
firefox-esr153
firefox141
firefox142
firefox143
firefox152
firefox153
firefox154
---
QA Whiteboard:
---
Has STR:
---
Change Request:
---
Signature:
None
This bug is publicly visible.

 
Attached file testcase 1 β€” Details

(spinning this off from bug 1886616)

STR:

  1. Load attached testcase.

EXPECTED RESULTS:
The dropdown button should size to fit its <option>s, and should show "Can you see me?" (the selected one) or whatever selection you pick.

ACTUAL RESULTS:
The first dropdown-button is sized as if it were empty.
Both dropdown-buttons are blank (initially, and also if you explicitly try to pick an option).

This is triggered by content:none in the testcase. That style doesn't seem to make a difference here in Chrome, and it doesn't make a difference for other form-controls in Firefox either (I just tried it on button and multi-select <select> elements), so it's weird that we give it special significance for dropdown-menu select elements.

Reporter

Comment 1

β€’
10 months ago

Here's a variant with 'appearance:none' to remove native-theme impact. (Same bug happens here.)

Reporter

Comment 2

β€’
10 months ago

Regression range:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=536a892dd51f394af6c0638166e8cb7e467ae88c&tochange=1f8cbba9a51a930e1f81bd0f711faf057529e4d1

That's just when we added support for content:none in the first place, in bug 1699964 ( https://hg-edge.mozilla.org/mozilla-central/rev/dcc1d0a10a11 )

That did explicitly add a check for content:none to nsComboboxControlFrame.cpp, here:
https://hg-edge.mozilla.org/mozilla-central/rev/dcc1d0a10a11#l3.13

Maybe that's the culprit here?

At that point in time, that check made sense, because the spec text (quoted in bug 1699964 comment 0) said:

On elements, this inhibits the children of the element from being rendered as children of this element, as if the element was empty.

That's kinda what we're doing right now.

However the spec has changed, with none now being defined like so:

On elements, this behaves as normal.

Reporter

Comment 3

β€’
10 months ago
β€’

Probably we just need to remove the && !StyleContent()->mContent.IsNone() checks (for sizing and painting purposes):
https://searchfox.org/mozilla-central/rev/45aff2630491c295fc6c28198b629ff2de14e637/layout/forms/nsComboboxControlFrame.cpp#169-170,177

nscoord nsComboboxControlFrame::IntrinsicISize(const IntrinsicSizeInput& aInput,
 IntrinsicISizeType aType) {
...
 if (!containISize && !StyleContent()->mContent.IsNone()) {

https://searchfox.org/mozilla-central/rev/45aff2630491c295fc6c28198b629ff2de14e637/layout/forms/nsComboboxControlFrame.cpp#304,310

void nsComboboxControlFrame::GetLabelText(nsAString& aLabel) {
...
 if (mDisplayedIndex != -1 && !StyleContent()->mContent.IsNone()) {
Reporter

Updated

β€’
10 months ago
Keywords: regression
Regressed by: 1719239
Reporter

Comment 4

β€’
10 months ago

Hmm, supposedly content:none is supposed to be disabled for non-pseudo-elements, as of bug 1719239, via the layout.css.element-content-none.enabled about:config pref. So it's unexpected that content:none is even affecting a non-pseudo-element here. Clearly our check for that pref isn't as robust as it's intended to be.

(In any case, given the spec discussion in https://github.com/w3c/csswg-drafts/issues/6503 , we probably want to remove that pref entirely rather than polishing it and making it properly control support for content:none on elements.)

That pref is broken, it's getting checked in ToResolvedValue (the thing we expose in getComputedStyle) rather than ToComputedValue...

Set release status flags based on info from the regressing bug 1719239

Assignee: nobody β†’ emilio
Status: NEW β†’ ASSIGNED
Reporter

Updated

β€’
10 months ago
Blocks: old-prefs

Comment 8

β€’
10 months ago
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e0cc2150beb9 https://hg.mozilla.org/integration/autoland/rev/83bf92828693 Remove experimental, never-shipped support for content: none on elements. r=dholbert
Duplicate of this bug: 1917920
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/54026 for changes under testing/web-platform/tests

Comment 11

β€’
10 months ago
bugherder
Status: ASSIGNED β†’ RESOLVED
Closed: 10 months ago
Resolution: --- β†’ FIXED
Target Milestone: --- β†’ 143 Branch
Reporter

Updated

β€’
10 months ago
Regressions: 1979952
You need to log in before you can comment on or make changes to this bug.