mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Apply HTMLTableSectionElement
height presentational hint
This commit is contained in:
parent
3ffc7bd131
commit
ea80167723
Notes:
github-actions[bot]
2025-02-20 17:12:54 +00:00
Author: https://github.com/tcl3
Commit: ea80167723
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3613
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 66 additions and 1 deletions
|
@ -107,7 +107,8 @@ bool HTMLTableSectionElement::is_presentational_hint(FlyString const& name) cons
|
||||||
|
|
||||||
return first_is_one_of(name,
|
return first_is_one_of(name,
|
||||||
HTML::AttributeNames::background,
|
HTML::AttributeNames::background,
|
||||||
HTML::AttributeNames::bgcolor);
|
HTML::AttributeNames::bgcolor,
|
||||||
|
HTML::AttributeNames::height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLTableSectionElement::apply_presentational_hints(GC::Ref<CSS::CascadedProperties> cascaded_properties) const
|
void HTMLTableSectionElement::apply_presentational_hints(GC::Ref<CSS::CascadedProperties> cascaded_properties) const
|
||||||
|
@ -122,6 +123,9 @@ void HTMLTableSectionElement::apply_presentational_hints(GC::Ref<CSS::CascadedPr
|
||||||
else if (name == HTML::AttributeNames::bgcolor) {
|
else if (name == HTML::AttributeNames::bgcolor) {
|
||||||
if (auto color = parse_legacy_color_value(value); color.has_value())
|
if (auto color = parse_legacy_color_value(value); color.has_value())
|
||||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BackgroundColor, CSS::CSSColorValue::create_from_color(color.value()));
|
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BackgroundColor, CSS::CSSColorValue::create_from_color(color.value()));
|
||||||
|
} else if (name == HTML::AttributeNames::height) {
|
||||||
|
if (auto parsed_value = parse_dimension_value(value))
|
||||||
|
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Height, parsed_value.release_nonnull());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<!doctype html>
|
||||||
|
<table style="border: 1px solid red">
|
||||||
|
<thead style="display: block; height: 100px">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
thead text
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table style="border: 1px solid red">
|
||||||
|
<tbody style="display: block; height: 100px">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
tbody text
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table style="border: 1px solid red">
|
||||||
|
<tfoot style="display: block; height: 100px">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
tfoot text
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tr>
|
||||||
|
</table>
|
|
@ -0,0 +1,31 @@
|
||||||
|
<!doctype html>
|
||||||
|
<link rel="match" href="../../../../../../expected/wpt-import/html/rendering/non-replaced-elements/tables/table-row-group-height-ref.html">
|
||||||
|
<table style="border: 1px solid red">
|
||||||
|
<thead style="display: block" height="100">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
thead text
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table style="border: 1px solid red">
|
||||||
|
<tbody style="display: block" height="100">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
tbody text
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<table style="border: 1px solid red">
|
||||||
|
<tfoot style="display: block" height="100">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
tfoot text
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tr>
|
||||||
|
</table>
|
Loading…
Add table
Add a link
Reference in a new issue