LibWeb: Allow border="0" on HTMLInputElement

This commit is contained in:
Andreas Kling 2024-11-23 11:46:49 +01:00 committed by Andreas Kling
parent 1288452bc3
commit 6e85363a84
Notes: github-actions[bot] 2024-11-23 13:43:38 +00:00
2 changed files with 15 additions and 15 deletions

View file

@ -1610,7 +1610,7 @@ void HTMLInputElement::apply_presentational_hints(CSS::StyleProperties& style) c
else if (value.equals_ignoring_ascii_case("middle"sv))
style.set_property(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Middle));
} else if (name == HTML::AttributeNames::border) {
if (auto parsed_value = parse_non_negative_integer(value); parsed_value.has_value() && *parsed_value > 0) {
if (auto parsed_value = parse_non_negative_integer(value); parsed_value.has_value()) {
auto width_style_value = CSS::LengthStyleValue::create(CSS::Length::make_px(*parsed_value));
style.set_property(CSS::PropertyID::BorderTopWidth, width_style_value);
style.set_property(CSS::PropertyID::BorderRightWidth, width_style_value);

View file

@ -6,8 +6,8 @@ Rerun
Found 588 tests
564 Pass
24 Fail
576 Pass
12 Fail
Details
Result Test Name MessagePass <iframe marginwidth="200"> mapping to marginLeft
Pass <iframe marginwidth="1007"> mapping to marginLeft
@ -519,9 +519,9 @@ Pass <input border=" 00523 "> mapping to borderTopWidth
Pass <input border="200."> mapping to borderTopWidth
Pass <input border="200.25"> mapping to borderTopWidth
Pass <input border="200.7"> mapping to borderTopWidth
Fail <input border="0"> mapping to borderTopWidth
Fail <input border="-0"> mapping to borderTopWidth
Fail <input border="+0"> mapping to borderTopWidth
Pass <input border="0"> mapping to borderTopWidth
Pass <input border="-0"> mapping to borderTopWidth
Pass <input border="+0"> mapping to borderTopWidth
Pass <input border="+200"> mapping to borderTopWidth
Pass <input border="200in"> mapping to borderTopWidth
Pass <input border="200.25in"> mapping to borderTopWidth
@ -540,9 +540,9 @@ Pass <input border=" 00523 "> mapping to borderRightWidth
Pass <input border="200."> mapping to borderRightWidth
Pass <input border="200.25"> mapping to borderRightWidth
Pass <input border="200.7"> mapping to borderRightWidth
Fail <input border="0"> mapping to borderRightWidth
Fail <input border="-0"> mapping to borderRightWidth
Fail <input border="+0"> mapping to borderRightWidth
Pass <input border="0"> mapping to borderRightWidth
Pass <input border="-0"> mapping to borderRightWidth
Pass <input border="+0"> mapping to borderRightWidth
Pass <input border="+200"> mapping to borderRightWidth
Pass <input border="200in"> mapping to borderRightWidth
Pass <input border="200.25in"> mapping to borderRightWidth
@ -561,9 +561,9 @@ Pass <input border=" 00523 "> mapping to borderBottomWidth
Pass <input border="200."> mapping to borderBottomWidth
Pass <input border="200.25"> mapping to borderBottomWidth
Pass <input border="200.7"> mapping to borderBottomWidth
Fail <input border="0"> mapping to borderBottomWidth
Fail <input border="-0"> mapping to borderBottomWidth
Fail <input border="+0"> mapping to borderBottomWidth
Pass <input border="0"> mapping to borderBottomWidth
Pass <input border="-0"> mapping to borderBottomWidth
Pass <input border="+0"> mapping to borderBottomWidth
Pass <input border="+200"> mapping to borderBottomWidth
Pass <input border="200in"> mapping to borderBottomWidth
Pass <input border="200.25in"> mapping to borderBottomWidth
@ -582,9 +582,9 @@ Pass <input border=" 00523 "> mapping to borderLeftWidth
Pass <input border="200."> mapping to borderLeftWidth
Pass <input border="200.25"> mapping to borderLeftWidth
Pass <input border="200.7"> mapping to borderLeftWidth
Fail <input border="0"> mapping to borderLeftWidth
Fail <input border="-0"> mapping to borderLeftWidth
Fail <input border="+0"> mapping to borderLeftWidth
Pass <input border="0"> mapping to borderLeftWidth
Pass <input border="-0"> mapping to borderLeftWidth
Pass <input border="+0"> mapping to borderLeftWidth
Pass <input border="+200"> mapping to borderLeftWidth
Pass <input border="200in"> mapping to borderLeftWidth
Pass <input border="200.25in"> mapping to borderLeftWidth