Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1562057] Change size-contained & empty select elements to have the same inline-size. #19643

Merged
merged 1 commit into from Oct 13, 2019

Conversation

moz-wptsync-bot
Copy link
Collaborator

Per the css-contain specification, size contained elements must be sized as if
they were empty. Up until now, we've been handling that by just using "0" as
the intrinsic size of some components, but that doesn't actually match the size
of a "true" empty select, which has some nonzero width from:
(a) the default inline-axis padding on the display frame (added in a rule for
the ::-moz-display-comboboxcontrol-frame pseudo, in forms.css).

(b) the width (inline-size) of the display frame's "placeholder" space
character, which has a small intrinsic width (but which really only exists
for block-axis sizing and alignment, when no option is selected from
the dropdown).

This patch addresses issue (a) by explicitly adding the display frame's
inline-axis padding to size-contained elements, and it addresses issue (b) by
changing to use a zero-width space character in empty select elements.

So: as of this patch, size-contained select elements are getting a little wider
(to address (a)), and empty select elements are also getting a little skinnier
(to address (b)), and they'll end up being the same width.

(I chose U+FEFF "zero-width non-breaking-space" since we were previously using
a non-breaking space character. I'm not sure if the non-breaking aspect matters,
but I figured I'd preserve that to be on the safe side.)

Differential Revision: https://phabricator.services.mozilla.com/D48791

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1562057
gecko-commit: a8ea98346a87402b1c3ad4c892694d0de163a0b3
gecko-integration-branch: autoland
gecko-reviewers: TYLin

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

…-size.

Per the css-contain specification, size contained elements must be sized as if
they were empty. Up until now, we've been handling that by just using "0" as
the intrinsic size of some components, but that doesn't actually match the size
of a "true" empty select, which has some nonzero width from:
 (a) the default inline-axis padding on the display frame (added in a rule for
     the ::-moz-display-comboboxcontrol-frame pseudo, in forms.css).

 (b) the width (inline-size) of the display frame's "placeholder" space
     character, which has a small intrinsic width (but which really only exists
     for *block-axis* sizing and alignment, when no option is selected from
     the dropdown).

This patch addresses issue (a) by explicitly adding the display frame's
inline-axis padding to size-contained elements, and it addresses issue (b) by
changing to use a zero-width space character in empty select elements.

So: as of this patch, size-contained select elements are getting a little wider
(to address (a)), and empty select elements are also getting a little skinnier
(to address (b)), and they'll end up being the same width.

(I chose U+FEFF "zero-width non-breaking-space" since we were previously using
a non-breaking space character. I'm not sure if the non-breaking aspect matters,
but I figured I'd preserve that to be on the safe side.)

Differential Revision: https://phabricator.services.mozilla.com/D48791

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1562057
gecko-commit: 25d95be82e953bfe3758acb96c3fb80b9b602f5a
gecko-integration-branch: autoland
gecko-reviewers: TYLin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants