mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 15:58:47 +00:00
LibWeb: Correct HTMLMeterElement color selection
The logic of the comment "the region between the high boundary and the maximum value must be treated as the optimum region" is correct. However, the code below covered only two cases, the optimum case was missing. Fixes #473
This commit is contained in:
parent
4b924e6782
commit
a676bd97a7
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/simonkrauter
Commit: a676bd97a7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/474
Issue: https://github.com/LadybirdBrowser/ladybird/issues/473
Reviewed-by: https://github.com/tcl3
1 changed files with 3 additions and 1 deletions
|
@ -223,7 +223,9 @@ void HTMLMeterElement::update_meter_value_element()
|
|||
}
|
||||
// Finally, if the optimum point is higher than the high boundary, then the situation is reversed; the region between the high boundary and the maximum value must be treated as the optimum region, the region from the high boundary down to the low boundary must be treated as a suboptimal region, and the remaining region must be treated as an even less good region.
|
||||
else {
|
||||
if (value >= low && value <= high)
|
||||
if (value >= high && value <= max)
|
||||
m_meter_value_element->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::MeterOptimumValue);
|
||||
else if (value >= low && value <= high)
|
||||
m_meter_value_element->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::MeterSuboptimumValue);
|
||||
else
|
||||
m_meter_value_element->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::MeterEvenLessGoodValue);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue