LibWeb: Turn <td width> into a CSS width property

This commit is contained in:
Andreas Kling 2020-06-28 14:30:03 +02:00
parent 38d6cc8598
commit b8dc1fc195
Notes: sideshowbarker 2024-07-19 05:20:32 +09:00

View file

@ -25,6 +25,7 @@
*/
#include <LibWeb/DOM/HTMLTableCellElement.h>
#include <LibWeb/Parser/CSSParser.h>
namespace Web {
@ -53,6 +54,11 @@ void HTMLTableCellElement::apply_presentational_hints(StyleProperties& style) co
style.set_property(CSS::PropertyID::TextAlign, value.view());
return;
}
if (name == HTML::AttributeNames::width) {
if (auto parsed_value = parse_css_value(CSS::ParsingContext(document()), value))
style.set_property(CSS::PropertyID::Width, parsed_value.release_nonnull());
return;
}
});
}