mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +00:00
LibWeb: Avoid changing button border color on disable/hover
This commit is contained in:
parent
81b6a1100e
commit
82387e2127
Notes:
github-actions[bot]
2025-04-30 19:14:19 +00:00
Author: https://github.com/Psychpsyo
Commit: 82387e2127
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4538
Reviewed-by: https://github.com/AtkinsSJ ✅
6 changed files with 34 additions and 9 deletions
|
@ -53,22 +53,21 @@ button, input[type=submit], input[type=button], input[type=reset], select, ::fil
|
||||||
border: 1px solid ButtonBorder;
|
border: 1px solid ButtonBorder;
|
||||||
color: ButtonText;
|
color: ButtonText;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
/* FIXME: For some reason this filter is required for the :hover style to work */
|
|
||||||
filter: contrast(100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
button:disabled, input[type=submit]:disabled, input[type=button]:disabled, input[type=reset]:disabled, select:disabled {
|
&:hover {
|
||||||
filter: contrast(70%);
|
background-color: -libweb-ButtonFaceHover;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
background-color: -libweb-ButtonFaceDisabled;
|
||||||
|
color: GrayText;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=image] {
|
input[type=image] {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover, input[type=submit]:hover, input[type=button]:hover, input[type=reset]:hover, select:hover {
|
|
||||||
filter: contrast(70%);
|
|
||||||
}
|
|
||||||
|
|
||||||
option {
|
option {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
[
|
[
|
||||||
"-infinity",
|
"-infinity",
|
||||||
|
"-libweb-buttonfacedisabled",
|
||||||
|
"-libweb-buttonfacehover",
|
||||||
"-libweb-center",
|
"-libweb-center",
|
||||||
"-libweb-left",
|
"-libweb-left",
|
||||||
"-libweb-link",
|
"-libweb-link",
|
||||||
|
|
|
@ -50,6 +50,8 @@ bool CSSKeywordValue::is_color(Keyword keyword)
|
||||||
case Keyword::Inactivecaptiontext:
|
case Keyword::Inactivecaptiontext:
|
||||||
case Keyword::Infobackground:
|
case Keyword::Infobackground:
|
||||||
case Keyword::Infotext:
|
case Keyword::Infotext:
|
||||||
|
case Keyword::LibwebButtonfacedisabled:
|
||||||
|
case Keyword::LibwebButtonfacehover:
|
||||||
case Keyword::LibwebLink:
|
case Keyword::LibwebLink:
|
||||||
case Keyword::LibwebPaletteActiveLink:
|
case Keyword::LibwebPaletteActiveLink:
|
||||||
case Keyword::LibwebPaletteActiveWindowBorder1:
|
case Keyword::LibwebPaletteActiveWindowBorder1:
|
||||||
|
@ -205,6 +207,10 @@ Color CSSKeywordValue::to_color(Optional<Layout::NodeWithStyle const&> node) con
|
||||||
return SystemColor::selected_item(scheme);
|
return SystemColor::selected_item(scheme);
|
||||||
case Keyword::Selecteditemtext:
|
case Keyword::Selecteditemtext:
|
||||||
return SystemColor::selected_item_text(scheme);
|
return SystemColor::selected_item_text(scheme);
|
||||||
|
case Keyword::LibwebButtonfacedisabled:
|
||||||
|
return SystemColor::button_face(scheme).with_alpha(128);
|
||||||
|
case Keyword::LibwebButtonfacehover:
|
||||||
|
return SystemColor::button_face(scheme).darkened(0.8f);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<style>
|
||||||
|
div {
|
||||||
|
background-color: green;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div></div>
|
9
Tests/LibWeb/Ref/input/disabled-button-border-color.html
Normal file
9
Tests/LibWeb/Ref/input/disabled-button-border-color.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<link rel="match" href="../expected/disabled-button-border-color-ref.html" />
|
||||||
|
<style>
|
||||||
|
button {
|
||||||
|
padding: 0;
|
||||||
|
border: 50px solid green;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<button disabled></button>
|
Binary file not shown.
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 18 KiB |
Loading…
Add table
Add a link
Reference in a new issue