Skip to content

Truly independent web browser

LibWeb: Use ButtonBorder consistently for native controls

Andreas Kling69d61b3d5ed8
diff --git a/Libraries/LibWeb/CSS/Default.css b/Libraries/LibWeb/CSS/Default.css
index 0394aa61440..f02dda1df26 100644
--- a/Libraries/LibWeb/CSS/Default.css
+++ b/Libraries/LibWeb/CSS/Default.css
@@ -30,7 +30,7 @@ label {
/* FIXME: This is a temporary hack until we can render a native-looking frame for these. */
input:not([type=submit], input[type=button], input[type=image], input[type=reset], input[type=color], input[type=checkbox], input[type=file], input[type=radio], input[type=range]), textarea {
- border: 1px solid light-dark(#767676, #858585);
+ border: 1px solid ButtonBorder;
padding: 1px 2px;
min-height: 16px;
cursor: text;
@@ -50,6 +50,10 @@ textarea {
overflow-wrap: break-word;
}
+input[type=color] {
+ border-color: ButtonBorder;
+}
+
input::placeholder, textarea::placeholder {
color: GrayText;
line-height: initial;
@@ -58,7 +62,7 @@ input::placeholder, textarea::placeholder {
button, input[type=submit], input[type=button], input[type=reset], select, ::file-selector-button {
padding: 1px 4px;
background-color: ButtonFace;
- border: 1px solid light-dark(#767676, #858585);
+ border: 1px solid ButtonBorder;
color: ButtonText;
cursor: default;
diff --git a/Libraries/LibWeb/Rust/src/css/color_resolution.rs b/Libraries/LibWeb/Rust/src/css/color_resolution.rs
index a40aa5e89a9..220b59dc6d6 100644
--- a/Libraries/LibWeb/Rust/src/css/color_resolution.rs
+++ b/Libraries/LibWeb/Rust/src/css/color_resolution.rs
@@ -560,8 +560,10 @@ fn active_text(dark: bool) -> Rgba {
if dark { rgb(213, 97, 82) } else { rgb(255, 0, 0) }
}
+// https://drafts.csswg.org/css-color-4/#css-system-colors
+// The base border color for push buttons.
fn button_border(dark: bool) -> Rgba {
- if dark { rgb(255, 255, 255) } else { rgb(0, 0, 0) }
+ if dark { rgb(133, 133, 133) } else { rgb(118, 118, 118) }
}
fn button_face(dark: bool) -> Rgba {
diff --git a/Tests/LibWeb/Screenshot/expected-macos/color-scheme.png b/Tests/LibWeb/Screenshot/expected-macos/color-scheme.png
index 72c9d57be63..5898055e98b 100644
Binary files a/Tests/LibWeb/Screenshot/expected-macos/color-scheme.png and b/Tests/LibWeb/Screenshot/expected-macos/color-scheme.png differ
diff --git a/Tests/LibWeb/Screenshot/expected/color-scheme.png b/Tests/LibWeb/Screenshot/expected/color-scheme.png
index cbb5647a4f1..32c284a2687 100644
Binary files a/Tests/LibWeb/Screenshot/expected/color-scheme.png and b/Tests/LibWeb/Screenshot/expected/color-scheme.png differ
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-color/system-color-consistency.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-color/system-color-consistency.txt
index 909d996ab10..be8ed55afa0 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-color/system-color-consistency.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-color/system-color-consistency.txt
@@ -2,15 +2,15 @@ Harness status: OK
Found 62 tests
-54 Pass
-8 Fail
-Fail Property color value 'ButtonBorder' resolves to the same color as the border-color of a button (light)
+60 Pass
+2 Fail
+Pass Property color value 'ButtonBorder' resolves to the same color as the border-color of a button (light)
Pass Property color value 'ButtonFace' resolves to the same color as the background-color of a button (light)
Pass Property color value 'ButtonText' resolves to the same color as text on a button (light)
-Fail Property color value 'ButtonBorder' resolves to the same color as the border-color of a submit button (light)
+Pass Property color value 'ButtonBorder' resolves to the same color as the border-color of a submit button (light)
Pass Property color value 'ButtonFace' resolves to the same color as the background-color of a submit button (light)
Pass Property color value 'ButtonText' resolves to the same color as text on a submit button (light)
-Fail Property color value 'ButtonBorder' resolves to the same color as the border-color of a reset button (light)
+Pass Property color value 'ButtonBorder' resolves to the same color as the border-color of a reset button (light)
Pass Property color value 'ButtonFace' resolves to the same color as the background-color of a reset button (light)
Pass Property color value 'ButtonText' resolves to the same color as text on a reset button (light)
Pass Property color value 'ButtonBorder' resolves to the same color as the border-color of a color picker (light)
@@ -35,13 +35,13 @@ Pass Property color value 'LinkText' has the same color as the color of an ancho
Pass LinkText should not match Canvas in light mode
Pass ActiveText should not match Canvas in light mode
Pass VisitedText should not match Canvas in light mode
-Fail Property color value 'ButtonBorder' resolves to the same color as the border-color of a button (dark)
+Pass Property color value 'ButtonBorder' resolves to the same color as the border-color of a button (dark)
Pass Property color value 'ButtonFace' resolves to the same color as the background-color of a button (dark)
Pass Property color value 'ButtonText' resolves to the same color as text on a button (dark)
-Fail Property color value 'ButtonBorder' resolves to the same color as the border-color of a submit button (dark)
+Pass Property color value 'ButtonBorder' resolves to the same color as the border-color of a submit button (dark)
Pass Property color value 'ButtonFace' resolves to the same color as the background-color of a submit button (dark)
Pass Property color value 'ButtonText' resolves to the same color as text on a submit button (dark)
-Fail Property color value 'ButtonBorder' resolves to the same color as the border-color of a reset button (dark)
+Pass Property color value 'ButtonBorder' resolves to the same color as the border-color of a reset button (dark)
Pass Property color value 'ButtonFace' resolves to the same color as the background-color of a reset button (dark)
Pass Property color value 'ButtonText' resolves to the same color as text on a reset button (dark)
Pass Property color value 'ButtonBorder' resolves to the same color as the border-color of a color picker (dark)
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-input-element/color.txt b/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-input-element/color.txt
index 02f5fcbafe3..312e83cfe85 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-input-element/color.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-input-element/color.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 27 tests
-26 Pass
-1 Fail
+27 Pass
Pass Empty value should return #000000
Pass Missing value should return #000000
Pass Valid simple color: should return #ffffff
@@ -30,4 +29,4 @@ Pass Invalid color: PILE OF POO (U+1F4A9)
Pass Valid color: hsl(150deg 100 53.5)
Pass Valid color: color(display-p3 .5 0 0)
Pass Valid color: color(display-p3 1 0 0)
-Fail System colors are parsed
\ No newline at end of file
+Pass System colors are parsed
\ No newline at end of file