mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb/HTML: Check all radio buttons in group for required attribute
This fixes a bug in the algorithm for determining if radio buttons are missing their value. Previously it was only checked if the button itself is required. Now the algorithm checks if the radio button group contains a required radio button in order to determine if the value is required.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
f7442ae907
commit
c01dc5900a
Notes:
github-actions[bot]
2025-08-17 20:28:15 +00:00
Author: https://github.com/skyz1 Commit: https://github.com/LadybirdBrowser/ladybird/commit/c01dc5900a0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5883 Reviewed-by: https://github.com/gmta ✅
@@ -7,6 +7,7 @@
|
||||
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
* Copyright (c) 2024, Fernando Kiotheka <fer@k6a.dev>
|
||||
* Copyright (c) 2025, Felipe Muñoz Mazur <felipe.munoz.mazur@protonmail.com>
|
||||
* Copyright (c) 2025, Glenn Skrzypczak <glenn.skrzypczak@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
@@ -3323,7 +3324,7 @@ bool HTMLInputElement::suffering_from_being_missing() const
|
||||
if (is_in_same_radio_button_group(*this, element)) {
|
||||
if (element.checked())
|
||||
has_checkedness_false_for_all_elements_in_group = false;
|
||||
if (has_attribute(HTML::AttributeNames::required))
|
||||
if (element.has_attribute(HTML::AttributeNames::required))
|
||||
has_required_element_in_group = true;
|
||||
}
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
Reference in New Issue
Block a user