mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
LibWeb: Map dimension attributes for table elements
This commit is contained in:
committed by
Andreas Kling
parent
728236f4d2
commit
140dc95e67
@@ -6,8 +6,10 @@
|
||||
|
||||
#include <LibWeb/Bindings/HTMLTableColElementPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/CSS/StyleProperties.h>
|
||||
#include <LibWeb/HTML/HTMLTableColElement.h>
|
||||
#include <LibWeb/HTML/Numbers.h>
|
||||
#include <LibWeb/HTML/Parser/HTMLParser.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
@@ -42,4 +44,16 @@ WebIDL::ExceptionOr<void> HTMLTableColElement::set_span(unsigned int value)
|
||||
return set_attribute(HTML::AttributeNames::span, MUST(String::number(value)));
|
||||
}
|
||||
|
||||
void HTMLTableColElement::apply_presentational_hints(CSS::StyleProperties& style) const
|
||||
{
|
||||
for_each_attribute([&](auto& name, auto& value) {
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#tables-2:maps-to-the-dimension-property-2
|
||||
if (name == HTML::AttributeNames::width) {
|
||||
if (auto parsed_value = parse_dimension_value(value)) {
|
||||
style.set_property(CSS::PropertyID::Width, *parsed_value);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user