Skip to content

Restore Servo's original form control theme colors#327

Merged
mrobinson merged 1 commit intomainfrom
restore-servo-original-form-theme-colors
Mar 10, 2026
Merged

Restore Servo's original form control theme colors#327
mrobinson merged 1 commit intomainfrom
restore-servo-original-form-theme-colors

Conversation

@mrobinson
Copy link
Copy Markdown
Member

@mrobinson mrobinson commented Mar 9, 2026

This change does two things:

  1. Restores Servo's original theme colors from before support for system color was added.
  2. Eliminates the selection of default system color based on the color scheme of the system. This code was dead code since is_dark_color_scheme always returns false.

Servo PR: servo/servo#43107

@Loirooriol
Copy link
Copy Markdown
Collaborator

It is important to use the same form control colors, because it is not guaranteed that web content is adapted for a dark theme. This is the behavior of Firefox, Chrome, and Safari.

No?

<!DOCTYPE html>
<button style="color-scheme: light">button</button>
<button style="color-scheme: dark">button</button>

Firefox:
imatge

Chrome:
imatge

WebKit:
imatge

@mrobinson
Copy link
Copy Markdown
Member Author

It is important to use the same form control colors, because it is not guaranteed that web content is adapted for a dark theme. This is the behavior of Firefox, Chrome, and Safari.

No?

<!DOCTYPE html>
<button style="color-scheme: light">button</button>
<button style="color-scheme: dark">button</button>

That is when the color-scheme property is set explicitly, but this doesn't work the same way if you set the system theme of your computer and load a page.:

Screenshot 2026-03-09 at 11 05 20

Also, note that this was calling is_dark_color_scheme() which always returns false:

    pub(crate) fn is_dark_color_scheme(&self, _: ColorSchemeFlags) -> bool {
        false
    }

@mrobinson
Copy link
Copy Markdown
Member Author

mrobinson commented Mar 9, 2026

It's quite possible you are correct about the color-scheme property here, but currently the dark color scheme code is dead code, so I think we should remove it for now and properly add support for it later as well as allowing the embedder to override the colors in a reasonable way.

EDIT: I've updated the PR description to reflect this.

@mrobinson mrobinson force-pushed the restore-servo-original-form-theme-colors branch from 258fde4 to dbf89be Compare March 9, 2026 12:18
Restores Servo's original theme colors from before support for system
color was added. Also, note that the dark theme code path is dead in a
comment.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
@mrobinson mrobinson force-pushed the restore-servo-original-form-theme-colors branch from dbf89be to 330f77e Compare March 9, 2026 12:27
@mrobinson mrobinson added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit 2373b81 Mar 10, 2026
5 checks passed
@mrobinson mrobinson deleted the restore-servo-original-form-theme-colors branch March 10, 2026 06:44
github-merge-queue Bot pushed a commit to servo/servo that referenced this pull request Mar 10, 2026
…theme colors" (#43107)

This change just updates the version of Stylo to a version which
restores the original Servo theme colors.

Stylo PR: servo/stylo#327
Testing: This just restore the original form control theme colors, so
should
not change test results. Manual testing was performed with the
`form-controls-visual.html` test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
github-merge-queue Bot pushed a commit to servo/servo that referenced this pull request Mar 10, 2026
…theme colors" (#43107)

This change just updates the version of Stylo to a version which
restores the original Servo theme colors.

Stylo PR: servo/stylo#327
Testing: This just restore the original form control theme colors, so
should
not change test results. Manual testing was performed with the
`form-controls-visual.html` test.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
github-merge-queue Bot pushed a commit to servo/servo that referenced this pull request Mar 10, 2026
…theme colors" (#43107)

This change just updates the version of Stylo to a version which
restores the original Servo theme colors.

Stylo PR: servo/stylo#327
Testing: This just restore the original form control theme colors, so
should
not change test results. Manual testing was performed with the
`form-controls-visual.html` test. One form tests starts to fail due to
subpixel differences. This test was failing originally (before form
control style was inadvertently changed). This likely happens due to
the rounded grey borders of buttons. This PR changes them back to
gray from black.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Apr 3, 2026
github-actions Bot pushed a commit to longvatrong111/stylo that referenced this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants